[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freeswitch-users
Subject:    Re: [Freeswitch-users] CURL headers
From:       Steven Schoch <schoch+freeswitch.org () xwin32 ! com>
Date:       2017-03-28 16:11:02
Message-ID: CAOkuKddX75rzF9rbokvk2ywZEpCg8aFHA1QnBBZ5yrpGAarRVw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I've been using headers in the api curl command for over a year. My lua
code looks like this:
-- url is in the form https://user:password@host/path
-- data is a JSON string in the form { "name":"value", "name2":"value2" }
api:execute("curl", url .. " content-type application/json post '" .. data
.. "'")

Which brings up a problem I'm having. Some time ago when I upgraded
FreeSWITCH, the user:password fields either started getting corrupted or
ignored, because I'm now getting a 401 error. I'm going to look through the
curl code to see if I can find where this is happening.

-- 
Steve

On Tue, Mar 28, 2017 at 8:29 AM, Michael Jerris <mike@jerris.com> wrote:

> in master it just got added to the api command, i don't think its in the
> js object.
>
> On Mar 28, 2017, at 6:43 AM, Matt Broad <matt@supportedbusiness.com>
> wrote:
>
> Hi,
>
> is it possible to add a header when using  the javascript function
> curl.run?
> I need to add a custom header.
>
> Below is an example of the script I currently use
>
> var curl = new CURL();
> curl.run("GET", "http://www.url.com", "details=value", curl_callback,
> "myarg");
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting@freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users@lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>

[Attachment #5 (text/html)]

<div dir="ltr">I&#39;ve been using headers in the api curl command for over a year. \
My lua code looks like this:<div>-- url is in the form \
https://user:password@host/path</div><div>-- data is a JSON string in the form { \
&quot;name&quot;:&quot;value&quot;, &quot;name2&quot;:&quot;value2&quot; \
}<br><div><div>api:execute(&quot;curl&quot;, url .. &quot; content-type \
application/json post &#39;&quot; .. data .. \
&quot;&#39;&quot;)</div></div><div><br></div></div><div>Which brings up a problem \
I&#39;m having. Some time ago when I upgraded FreeSWITCH, the user:password fields \
either started getting corrupted or ignored, because I&#39;m now getting a 401 error. \
I&#39;m going to look through the curl code to see if I can find where this is \
happening.</div><div><br></div><div>--  </div><div>Steve</div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 28, 2017 at 8:29 AM, \
Michael Jerris <span dir="ltr">&lt;<a href="mailto:mike@jerris.com" \
target="_blank">mike@jerris.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div style="word-wrap:break-word">in master it just got added \
to the api command, i don't think its in the js object.<span \
class=""><div><br><div><blockquote type="cite"><div>On Mar 28, 2017, at 6:43 AM, Matt \
Broad &lt;<a href="mailto:matt@supportedbusiness.com" \
target="_blank">matt@supportedbusiness.com</a>&gt; wrote:</div><br \
class="m_4826083116000553530Apple-interchange-newline"><div><div \
dir="ltr">Hi,<div><br></div><div>is it possible to add a header when using   the \
javascript function curl.run?</div><div>I need to add a custom \
header.</div><div><br></div><div>Below is an example of the script I currently \
use</div><div><br></div><div><div>var curl = new \
CURL();</div><div>curl.run(&quot;GET&quot;, &quot;<a href="http://www.url.com/" \
target="_blank">http://www.url.com</a>&quot;, &quot;details=value&quot;, \
curl_callback, &quot;myarg&quot;);<br></div></div><div><br></div></div></div></blockqu \
ote></div><br></div></span></div><br>______________________________<wbr>______________________________<wbr>_____________<br>
 Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" \
target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br> <br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" \
target="_blank">http://www.freeswitch.org</a><br> <a \
href="http://confluence.freeswitch.org" rel="noreferrer" \
target="_blank">http://confluence.freeswitch.<wbr>org</a><br> <a \
href="http://www.cluecon.com" rel="noreferrer" \
target="_blank">http://www.cluecon.com</a><br> <br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.<wbr>freeswitch.org</a><br>
 <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" \
rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
 UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" \
rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
 <a href="http://www.freeswitch.org" rel="noreferrer" \
target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>



_________________________________________________________________________
Professional FreeSWITCH Consulting Services: 
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic