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

Reply via email to