i'm trying to get a response from an httpwebrequest using get method and content type json..
but i'm getting Cannot send a content-body with this verb-type
here is my code:
Dim objRequest As HttpWebRequest = WebRequest.Create(url)
Dim reqBytes As Byte() = System.Text.UTF8Encoding.UTF8.GetBytes(strPost)
objRequest.Method = "GET"
objRequest.Timeout = "15000"
objRequest.ContentLength = reqBytes.Length
objRequest.ContentType = "application/json; charset=utf-8"
Try
myWriter = objRequest.GetRequestStream()
myWriter.Write(reqBytes, 0, reqBytes.Length)
Catch e As Exception
writetotext(e.toString)
End Try
am i missing something here?