Jump to content

WinHttp error getting data from Facebook graph api


EKY32
 Share

Go to solution Solved by trancexx,

Recommended Posts

Hello, I was using >WinHttp.au3 to get the source of a page:

https://graph.facebook.com/Eky32

#include "WinHttp.au3"

$sDomain = "https://graph.facebook.com/Eky32"

; Initialize and get session handle
$hOpen = _WinHttpOpen()
; Get connection handle
$hConnect = _WinHttpConnect($hOpen, $sDomain)

; SimpleSSL-request it...
$sReturned = _WinHttpSimpleSSLRequest($hConnect)

; Close handles
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)

; See what's returned
ConsoleWrite($sReturned)
;~ ClipPut($sReturned)

Data returned:

{"error":{"message":"Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api","type":"GraphMethodException","code":100}}

 

What is the problem with the GET request? It is working fine using _INetGetSource but I read somewhere that WinHttp get request is faster for bigger amount of data, some help please?

 

 

[font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]

Link to comment
Share on other sites

  • Solution

You are calling it wrong. Try this:

#include "WinHttp.au3"

$sDomain = "https://graph.facebook.com"

; Initialize and get session handle
$hOpen = _WinHttpOpen()
; Get connection handle
$hConnect = _WinHttpConnect($hOpen, $sDomain)

; SimpleSSL-request it...
$sReturned = _WinHttpSimpleSSLRequest($hConnect, Default, "Eky32")

; Close handles
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)

; See what's returned
ConsoleWrite($sReturned & @CRLF)

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...