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)
Warning: ns_ssl queue -timeout 30:0 -method GET -headers d8 https://graph.facebook.com/oauth/access_token?client_secret=c40a3c236ab440d71f327abb05979739&redirect_uri=https%3a%2f%2fwww.evex.co%2fcore%2ffb-login&code=AQCr5jYQemDY68393hxMPwtlux3rUEAyxQfhGS-KHeXkh0t7ezbK7YXWaOSgvmyChF4GAU7wF4eV2ikNsXsJkxSL1NDEduy4SOhl-k0NsTDwS5iv0onuLNPA-m5DHb_bK9j66q0TYq1g4ecXwEAioUsXYYp50yawC3-1Fsu7lS0NyqWF_2f23kiqf8CyN_hwUrn4vhlLcZJgkxu2wHrjfumLaD70X8lvQuRGzPhEq2Tt_pyRg80pKnSjL1RfMZ3noI_8a025sYFUJFNKE59a_cAWYuXaCZBkqE9OjEOg6y_qDkYFc2ocJ0XRos42QviwvDo&client_id=419233248412711 is deprecated. Use 'ns_http' instead!
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,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.
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?
-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