Gustaf,

I replaced [ns_http RUN -method GET ...] to [util::http::get ..].
Now I can see the request result and I 'm able top proceed writing a parsing code. Furthermore, I noticed a warning about this OACS ad_proc has been deprecated.  

Shouldn't we fix in OACS too? Well, what is the actual ad_proc we should use: ns_http or util::http::get?
For this task everything will be under OACS, so I believe the recommended is the last one) 





Best wishes,
Iuri

-------- Original Message --------
Subject: Re: [naviserver-devel] ns_http request results HTTP0
From: Gustaf Neumann <neum...@wu.ac.at>
Date: Sun, April 02, 2017 2:28 am
To: naviserver-devel@lists.sourceforge.net

Am 02.04.17 um 00:54 schrieb Iuri Sampaio:
Hi there,

I wonder what HTTP0 means as a result of ns_http. How do I open it? Is it a TDOM object? Should I pass the result variable in the method call?
the result of ns_http depends on the used subcommand. For the subcommands "queue" and "run" the result is a handle to an open connection, which can be used in a subsequent "ns_http wait" or "ns_http cancel". For details, see [1]. For usage in OpenACS, util::http::get or util::http::post, which is a layer on top of ns_http.

-g
PS: in the provided snippet, you are using an invalid content-type


[1] https://naviserver.sourceforge.io/n/naviserver/files/ns_http.html
[2] http://openacs.org/api-doc/proc-view?proc=util::http::get

the following chunk of code returns page with HTTP0 assigned:

 set url [export_vars -base "https://graph.facebook.com/oauth/access_token" \
                 {{client_id $appid} {redirect_uri $return_url} {client_secret $appkey} {code $code}}]

 set queryHeaders [ns_set create]
 ns_set update $queryHeaders Host https://www.evex.co
 ns_set update $queryHeaders Content-Type HTML

 set page [ns_http run -headers $queryHeaders -timeout 10.0 -method GET $url]
 ns_log Notice "$page"



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to