You must provide a request body...

jamie_pattison

Well-known member
Joined
Sep 9, 2008
Messages
116
Programming Experience
Beginner
VB.NET:
                If System.Net.HttpStatusCode.OK Then
                        responseEncoding = System.Text.Encoding.UTF8
                        responseStream = HttpWResponse.GetResponseStream()
                        responseReader = New StreamReader(responseStream, responseEncoding)
                        responseContent = responseReader.ReadToEnd()
                        Return responseContent
                End If

For the above code im trying to send a request with PostData but i receive the error "You must provide a request body if you set ContentLength>0 or SendChunked==true. Do this by calling [Begin]GetRequestStream before [Begin]GetResponse."

If i change the code around it doesnt work. Could anyone assist or explain what is going wrong here please? Searching around my code is similar to what others have and they have it working but not sure where to start to diagnose where the problem is.

Thanks in advance
 
Last edited:
Back
Top