CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2013

    HttpWebRequest Response - Getting {"state":"AD_DEFERRED","defferedLink":"/post?guid="

    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
    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
                '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

  2. #2
    Join Date
    Jul 2001
    Sunny South Africa

    Re: HttpWebRequest Response - Getting {"state":"AD_DEFERRED","defferedLink":"/post?gu

    In your response there is a mention of Facebook. Are you trying to to something with Facebook?

    If that is the case you need to look into Facebook's API's, especially the GraphAPI:

    Keep in mind though that Facebook's way of things keep changing regularly
    All my Articles

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width