Hi, can you help.
After sending a POST request on a Web Form, I get the below code from the HttpWebRequest Response :
I didn't include the code for login.
Below is my code for POST and the response.
Posting CODE
Code:
Imports System.Net
Imports System.Text
Imports System.IO
Imports System.Diagnostics
Imports System.IO.Compression
Module CleanCodePost
'Public logincookiePost As CookieContainer
'Calls request functions sequentially.
Public Sub MakeRequestsCleanPost()
Dim response As HttpWebResponse
Dim responseText As String
If Request_mypostquery(response) Then
'Success, possibly use response.
responseText = ReadResponse(response)
Form3.txtbx_descript.Text = responseText
response.Close()
Else
'Failure, cannot use response.
End If
End Sub
'Returns the text contained in the response. For example, the page HTML. Only handles the most common HTTP encodings.
Private Function ReadResponse(response As HttpWebResponse) As String
Using responseStream = response.GetResponseStream()
Dim streamToRead As Stream = responseStream
If response.ContentEncoding.ToLower().Contains("gzip") Then
streamToRead = New GZipStream(streamToRead, CompressionMode.Decompress)
ElseIf response.ContentEncoding.ToLower().Contains("deflate") Then
streamToRead = New DeflateStream(streamToRead, CompressionMode.Decompress)
End If
The response I get
Code:
{"state":"AD_DEFERRED","defferedLink":"/post?guid=fce4674d-bbf3-4208-8b72-26a2077df872-15bcf50da73","links":{"emailLogin":"/login.html?redirect=/post?guid=fce4674d-bbf3-4208-8b72-26a2077df872-15bcf50da73","register":"/register.html?redirect=/post?guid=fce4674d-bbf3-4208-8b72-26a2077df872-15bcf50da73","facebookLogin":"/social/facebook/authorize?return=/post?guid=fce4674d-bbf3-4208-8b72-26a2077df872-15bcf50da73"}}