Sign in to follow this  
Followers 0
EKY32

WinHttp error getting data from Facebook graph api

6 posts in this topic

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]

Share this post


Link to post
Share on other sites



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)
1 person likes this

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Thank you, I love your work very much.


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

Share this post


Link to post
Share on other sites

What is the timeout of the HTTP get request? and is there a way to control it?


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

Share this post


Link to post
Share on other sites

Well, there is _WinHttpSetTimeouts() function inside the UDF.

1 person likes this

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Another thank you. ♥


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

Share this post


Link to post
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
Sign in to follow this  
Followers 0