HttpWebRequest POST no longer working to Canada Post website

  • Thread starter Thread starter leeedw
  • Start date Start date
L

leeedw

Hi there,

We have an application that posts data to the canadapost.ca website to
retrieve postal codes. This was working for quite some time until this
week when Canada Post changed their website. Now it no longer works.
Here is the code snippet:

Const CANADA_POST_URL As String =
"http://www.canadapost.ca/tools/pcl/bin/cp_search_response-e.asp"

' Create the web request.
objWebRequest =
CType(System.Net.WebRequest.Create(CANADA_POST_URL),
System.Net.HttpWebRequest)
objWebRequest.Method = "POST"
objWebRequest.ContentType =
"application/x-www-form-urlencoded"
objWebRequest.ContentLength = aPostData.Length

' Write the post data.
objStream = objWebRequest.GetRequestStream()
objStream.Write(aPostData, 0, aPostData.Length)
objStream.Close()

Anyone know how I can post to their website now?
Thanks!
 
Back
Top