private string DoRequest(string url, string requestString)
{
byte[] bytes = new ASCIIEncoding().GetBytes(requestString);
var request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = bytes.Length;
var requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
var response = request.GetResponse();
string responseXML = string.Empty;
using (var reader = new StreamReader(response.GetResponseStream()))
responseXML = reader.ReadToEnd();
return responseXML;
}
value of requestString is :
API=RateV3&XML=<RateV3Request USERID=\"MYUSR\" PASSWORD="MYPWD"><Package ID="0"><Service>ALL</Service><ZipOrigination>90503</ZipOrigination><ZipDestination>90210</ZipDestination><Pounds>2</Pounds><Ounces>0</Ounces><Size>Regular</Size><Machinable>FALSE</Machinable></Package></RateV3Request>
and value of url is:
http://production.shippingapis.com/ShippingAPI.dll
USPS approve me production request. I am trying to get this from VS in local environment.
nopCommerce version is 1.9.
Thanks!