From: <iu...@iu...> - 2017-04-02 21:46:55
|
<html><body><span style="font-family:Verdana; color:#000000; font-size:10pt;"><div>Gustaf,</div><div><br></div><div>I replaced [ns_http RUN -method GET ...] to [util::http::get ..]. </div><div>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. </div><div><br></div><div>Shouldn't we fix in OACS too? Well, what is the actual ad_proc we should use: ns_http or util::http::get? </div><div>For this task everything will be under OACS, so I believe the recommended is the last one) </div><div><b style=""><br></b></div><div><b style=""><br></b></div><div><br></div><div> <style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo} span.s1 {font-variant-ligatures: no-common-ligatures; color: #34bd26} span.s2 {font-variant-ligatures: no-common-ligatures} </style> </div><div class="p1" style=""><span class="s1"> </span><span class="s2" style=""><b style="">Warning: ns_ssl queue -timeout 30:0 -method GET -headers d8 <a href="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">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</a> is deprecated. Use 'ns_http' instead!</b></span></div><div><br></div><div><br></div><div>Best wishes,</div><div>Iuri</div><div><br></div> <blockquote id="replyBlockquote" webmail="1" style="border-left: 2px solid blue; margin-left: 8px; padding-left: 8px; font-size:10pt; color:black; font-family:verdana;"> <div id="wmQuoteWrapper"> -------- Original Message --------<br> Subject: Re: [naviserver-devel] ns_http request results HTTP0<br> From: Gustaf Neumann <<a href="mailto:ne...@wu...">ne...@wu...</a>><br> Date: Sun, April 02, 2017 2:28 am<br> To: <a href="mailto:nav...@li...">nav...@li...</a><br> <br> <div class="moz-cite-prefix">Am 02.04.17 um 00:54 schrieb Iuri Sampaio:<br> </div> <blockquote cite="mid:58E...@iu..." type="cite"> Hi there,<br> <br> 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?<br> </blockquote> 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.<br> <br> -g<br> PS: in the provided snippet, you are using an invalid content-type<br> <br> <br> [1] <a target="_blank" class="moz-txt-link-freetext" href="https://naviserver.sourceforge.io/n/naviserver/files/ns_http.html">https://naviserver.sourceforge.io/n/naviserver/files/ns_http.html</a><br> [2] <a target="_blank" class="moz-txt-link-freetext" href="http://openacs.org/api-doc/proc-view?proc=util::http::get">http://openacs.org/api-doc/proc-view?proc=util::http::get</a><br> <blockquote cite="mid:58E...@iu..." type="cite"> <br> the following chunk of code returns page with HTTP0 assigned:<br> <br> <small><i> set url [export_vars -base <a target="_blank" moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="https://graph.facebook.com/oauth/access_token">"https://graph.facebook.com/oauth/access_token"</a> \</i><i><br> </i><i> {{client_id $appid} {redirect_uri $return_url} {client_secret $appkey} {code $code}}]</i><i><br> </i><i><br> </i><i> set queryHeaders [ns_set create]</i><i><br> </i><i> ns_set update $queryHeaders Host <a target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext" href="https://www.evex.co">https://www.evex.co</a></i><i><br> </i><i> ns_set update $queryHeaders Content-Type HTML</i><i><br> </i><i><br> </i><i> set page [ns_http run -headers $queryHeaders -timeout 10.0 -method GET $url]</i><i><br> </i><i> ns_log Notice "$page"</i><i><br> </i><i> </i><i><br> </i></small></blockquote> <br> <hr>------------------------------------------------------------------------------<br> Check out the vibrant tech community on one of the world's most<br> engaging tech sites, <a href="http://Slashdot.org">Slashdot.org</a>! http://sdm.link/slashdot<hr>_______________________________________________<br> naviserver-devel mailing list<br> <a href="mailto:nav...@li...">nav...@li...</a><br> <a href="https://lists.sourceforge.net/lists/listinfo/naviserver-devel">https://lists.sourceforge.net/lists/listinfo/naviserver-devel</a><br> </div> </blockquote></span></body></html> |