Http Request questions

Just starting out? Need help? Post your questions and find answers here.
ynkrc
User
User
Posts: 55
Joined: Sat Sep 03, 2011 5:28 am

Http Request questions

Post by ynkrc »

like this:

Code: Select all

InitNetwork()

NewMap Header$()
  Header$("Content-Type") = "plaintext"
  Header$("UserAgent") = "Firefox 54.0"
  httpheader$=GetHTTPHeader("https://www.google.com",#PB_HTTP_NoRedirect,Header$("UserAgent"))
  HttpRequest = HTTPRequest(#PB_HTTP_Get, "https://www.google.com", "", 0, Header$())
  If HttpRequest
    Debug "StatusCode: " + HTTPInfo(HTTPRequest, #PB_HTTP_StatusCode)
    Debug "Response: " + HTTPInfo(HTTPRequest, #PB_HTTP_Response)
    
    FinishHTTP(HTTPRequest)
  Else
    Debug "Request creation failed"
  EndIf
GetHTTPHeaderand HTTPRequest seem to be two query operations,the infomation got can't match each other.
but how can I get the real ResponseHeader of the HTTPRequest ,like the libCurl setting below?

Code: Select all

curl_setopt($ch, CURLOPT_HEADER, 1);
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Http Request questions

Post by infratec »

This is not possible at the moment.
Fred has not implemented this up to now. But it is on the feature request list.

So you have to use libcurl.pbi
Post Reply