[Freeswitch-users] mod-curl POST

Rupa Schomaker rupa at rupa.com
Fri Feb 8 04:49:48 MSK 2013


Umm.. I just explained how to do it.  The only piece missing is the setting
of the content-type header, but if that isn't going to be a problem you
odn't have to do anything special.

Just remember to urlencode the (full) contents of the XML.

And try it out.  Use wireshark to see what is sent over the wire to the
server.


On Thu, Feb 7, 2013 at 11:26 AM, JP <jaykris at gmail.com> wrote:

> Yes what I am looking for is to POST xml data in the body and not as
> name/value pairs. Is this possible?
>
> Thanks,
> -JP
>
> On Wed, Feb 6, 2013 at 7:21 PM, Rupa Schomaker <rupa at rupa.com> wrote:
>
>>
>>
>>
>> On Wed, Feb 6, 2013 at 6:56 PM, Cal Leeming [Simplicity Media Ltd] <
>> cal.leeming at simplicitymedialtd.co.uk> wrote:
>>
>>> The docs says this;
>>>
>>> curl url [headers|json] [get|head|post [url_encode_data]]
>>>
>>
>> The [headers|json] is all about the response format.  Just to make sure
>> that is clear.
>>
>> get/head/post should be self-evident
>>
>> url_encode_data is supposed to be the url encoded version of what you
>> want to send to the server.  It is encoded on purpose (so that we don't
>> have to worry about embedded spaces or other special chars).
>>
>> So, you really just need to do:
>>
>> curl http://example.com/ post encodedxmlhere
>>
>>
>>> So, I assume you'd just do.
>>>
>>> curl http://example.com/ post xml=encodedxmlhere
>>>
>>>
>> This will result in www-url-encoded with key/value pair with xml as key
>> and the encoded xml as the value.  This may be what the OP wants, but I
>> think what he wants is just XML.
>>
>>
>> Note that the content-type will still be application/x-www-form-urlencoded
>> which is "wrong".  I've written xml service endpoints that behave
>> differently based on the content-type.  Depending on how your service is
>> written this may be ok or not.  There is an open ticket to address the
>> content-type issue.
>>
>> http://jira.freeswitch.org/browse/FS-4714
>>
>>
>>
>>> Taken from here;
>>> http://wiki.freeswitch.org/wiki/Mod_curl
>>>
>>> Hope this helps, apologies if I misunderstood the question
>>>
>>> Cal
>>>
>>>
>> --
>> -Rupa
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> 
>> 
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
-Rupa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130207/7a556689/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list