Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HttpWebRequest lost whitespace

Status
Not open for further replies.

guitardave78

Programmer
Sep 5, 2001
1,294
GB
Hey all
I am using the following function.

Code:
    Function httpCall(ByVal url As String, ByVal postdata As String) As String
        Dim request As HttpWebRequest
        Dim response As HttpWebResponse
        request = CType(WebRequest.Create(url), HttpWebRequest)
        request.ContentType = "application/x-[URL unfurl="true"]www-form-urlencoded"[/URL]
        request.ContentLength = postdata.Length
        request.Method = "POST"
        request.AllowAutoRedirect = False

        Dim requestStream As Stream = request.GetRequestStream()
        Dim postBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(postdata)
        requestStream.Write(postBytes, 0, postBytes.Length)
        requestStream.Close()
        response = CType(request.GetResponse(), HttpWebResponse)
        httpCall = New StreamReader(response.GetResponseStream()).ReadToEnd()
    End Function

It returns a value, but i seem to lose any white space!!

Any ideas


}...the bane of my life!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top