CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

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

  1. #1
    Join Date
    Mar 2013
    Posts
    22

    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
    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"}}

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,268

    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:
    http://www.codeguru.com/vb/gen/article.php/c19071/

    Keep in mind though that Facebook's way of things keep changing regularly
    [SIGPIC][/SIGPIC]
    All my Articles
    Hannes

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)