How do I POST some XML data to a URL using mod_curl? I want to call it from a Lua script. I cannot use the usual "key=value" format in the URL for my scenario. Thanks, JP
The docs says this; curl url [headers|json] [get|head|post [url_encode_data]] So, I assume you'd just do. curl http://example.com/ post xml=encodedxmlhere Taken from here; http://wiki.freeswitch.org/wiki/Mod_curl Hope this helps, apologies if I misunderstood the question Cal On Thu, Feb 7, 2013 at 12:44 AM, JP <jaykris@gmail.com> wrote:
How do I POST some XML data to a URL using mod_curl? I want to call it from a Lua script. I cannot use the usual "key=value" format in the URL for my scenario.
Thanks, JP
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
Thanks for the response. I want the XML data to go as the body of the POST and not as part of the URL. -JP On Wed, Feb 6, 2013 at 4:56 PM, Cal Leeming [Simplicity Media Ltd] < cal.leeming@simplicitymedialtd.co.uk> wrote:
The docs says this;
curl url [headers|json] [get|head|post [url_encode_data]]
So, I assume you'd just do.
curl http://example.com/ post xml=encodedxmlhere
Taken from here; http://wiki.freeswitch.org/wiki/Mod_curl
Hope this helps, apologies if I misunderstood the question
Cal
On Thu, Feb 7, 2013 at 12:44 AM, JP <jaykris@gmail.com> wrote:
How do I POST some XML data to a URL using mod_curl? I want to call it from a Lua script. I cannot use the usual "key=value" format in the URL for my scenario.
Thanks, JP
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
On Wed, Feb 6, 2013 at 6:56 PM, Cal Leeming [Simplicity Media Ltd] < cal.leeming@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
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@rupa.com> wrote:
On Wed, Feb 6, 2013 at 6:56 PM, Cal Leeming [Simplicity Media Ltd] < cal.leeming@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
Hi JP,
From what I can tell, this is not possible.
Some options are; * Submit a ticket to JIRA asking for this feature * If you have control over the end point, add support for non XML POST requests. * If you have no control over the end point, create a proxy script which transforms the POST request into the necessary format and passes it along Hope this helps Cal On Thu, Feb 7, 2013 at 5:26 PM, JP <jaykris@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@rupa.com> wrote:
On Wed, Feb 6, 2013 at 6:56 PM, Cal Leeming [Simplicity Media Ltd] < cal.leeming@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
Thanks Cal, Let me weigh my options and figure out what is the best approach for me. Regards, JP On Thu, Feb 7, 2013 at 10:14 AM, Cal Leeming [Simplicity Media Ltd] < cal.leeming@simplicitymedialtd.co.uk> wrote:
Hi JP,
From what I can tell, this is not possible.
Some options are;
* Submit a ticket to JIRA asking for this feature * If you have control over the end point, add support for non XML POST requests. * If you have no control over the end point, create a proxy script which transforms the POST request into the necessary format and passes it along
Hope this helps
Cal
On Thu, Feb 7, 2013 at 5:26 PM, JP <jaykris@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@rupa.com> wrote:
On Wed, Feb 6, 2013 at 6:56 PM, Cal Leeming [Simplicity Media Ltd] < cal.leeming@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
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@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@rupa.com> wrote:
On Wed, Feb 6, 2013 at 6:56 PM, Cal Leeming [Simplicity Media Ltd] < cal.leeming@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
-- -Rupa
Sorry Rupa, I didn't read your email properly before hand and didn't realise there was already a ticket for this issue. Thanks Cal On Fri, Feb 8, 2013 at 1:49 AM, Rupa Schomaker <rupa@rupa.com> wrote:
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@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@rupa.com> wrote:
On Wed, Feb 6, 2013 at 6:56 PM, Cal Leeming [Simplicity Media Ltd] < cal.leeming@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
-- -Rupa
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
Thanks Rupa. I guess I need to re-read your email to understand better. For now I have asked the vendor controlling the end point to switch to GET. I will try out what you suggested when I get some free cycles and update this thread. Regards, JP On Thu, Feb 7, 2013 at 5:49 PM, Rupa Schomaker <rupa@rupa.com> wrote:
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@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@rupa.com> wrote:
On Wed, Feb 6, 2013 at 6:56 PM, Cal Leeming [Simplicity Media Ltd] < cal.leeming@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
-- -Rupa
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
mod_curl will send a POST if you ask for it to (use post, not get in the call). You have to be precise when describing the issue. You don't want it to send as a form post, but rather just to post the 'raw' data. you can do this today. The ticket just gives you control of the header that sets the content-type. The receiver on the other end can choose to ignore the content type if it knows it should always just get raw XML. Use wireshark (or equiv) to verify what is being sent... On Fri, Feb 8, 2013 at 2:07 PM, JP <jaykris@gmail.com> wrote:
Thanks Rupa. I guess I need to re-read your email to understand better. For now I have asked the vendor controlling the end point to switch to GET. I will try out what you suggested when I get some free cycles and update this thread.
Regards, JP
On Thu, Feb 7, 2013 at 5:49 PM, Rupa Schomaker <rupa@rupa.com> wrote:
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@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@rupa.com> wrote:
On Wed, Feb 6, 2013 at 6:56 PM, Cal Leeming [Simplicity Media Ltd] < cal.leeming@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
-- -Rupa
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
-- -Rupa
participants (3)
-
Cal Leeming [Simplicity Media Ltd]
-
JP
-
Rupa Schomaker