[OpenSIPS-Users] OpenSIPS 2.4.3 Rest Client module
Ben Newlin
Ben.Newlin at genesys.com
Wed Nov 14 10:04:39 EST 2018
Hello,
After upgrading to 2.4.3 I have found that my tests using the REST client module are failing. It seems that some parameters to the rest_post client may have been inadvertently switched. Per the documentation [1], I am passing the body in the second parameter and the content type in the third.
async(rest_post("$var(uri)", "$json(resourceRequest)", "$var(send_ctype)", "$var(body)", "$var(recv_ctype)", "$var(rcode)"), resume);
But the request being sent out has the body and content type reversed:
{
"method" : "POST",
"path" : "/manager/v1/resources",
"headers" : {
"Host" : [ "203.0.113.6:1080" ],
"Accept" : [ "*/*" ],
"Content-Type" : [ "{ \"resources\": 1, \"capabilities\": [ \"sip-service\"" ],
"Content-Length" : [ "17" ]
},
"keepAlive" : true,
"secure" : false,
"body" : "application\\/json"
}
I’ve verified that in 2.4.2 the request is being created properly.
[1] https://opensips.org/html/docs/modules/2.4.x/rest_client.html#afunc_rest_post
Ben Newlin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20181114/374efcbd/attachment-0001.html>
More information about the Users
mailing list