Cookie using PUT method for a REST service
I'm trying to send a REST request using PUT method. The Cookie value is not being passed. It works fine when I test the service but when used via the app, it fails.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
I'm trying to send a REST request using PUT method. The Cookie value is not being passed. It works fine when I test the service but when used via the app, it fails.
Can you show how is your service setup?
I get 2 parameters from service 1 : id and url.
I copied them in local variables. Used alert to make sure that the values are being passed into correctly to those variables.
Then I pass these vaules into service 2. I added some javascript to the request parameter of service 2 to make sure I'm setting the desired header info. into Cookie.
Her's teh javascript:
var str = "visID=" + value;
alert("Cookie:" + str +" and str len:"+ str.length);
return str;
I see the right value being displayed here but it comes as blank on my backend server. I'm using Appery proxy and its still the same.
When you do Test from service it works but when you run from the page (via proxy) it doesn't work?
yes, thats correct and the only difference is while testing the service I hardcode the values whereas I'm passing the values using local variables when running from the page. But the values that show up in alert seem to be fine.
I'm not sure if the proxy passes on the cookie. If your service doesn't support cross-domain calls, run Chrome with security disabled and uncheck proxy to see if that works.
is it possible for you to take a look to see if I'm doing something wrong.
is there a way to know what header parameters are being passed by the proxy so I'm sure its not being blocked by Appery.
Hi - Do you tested it with Chrome +security desabled setting - "chrome –disable-web-security"? Were there any errors?
I don't see Cookie being sent as part of Header:
Request URL:
http://appery.io/app/rest/tunnel
Code: Select all
Request Method:
DELETE
Status Code:
HTTP/1.1 404 Not Found
Request Headers
22:19:48.000 User-Agent:Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0Referer:http://appery.io/app/view/75915bd3-43...
Authorization:Bearer hwniv1hwh9z1jiqntqxex10wnflxsyx8
appery-rest:2288567
appery-proxy-url:https://api.foundry.att.com/a1/vis/in...
appery-key:1369361965537Accept-Language:en-US,en;q=0.5Accept-Encoding:gzip, deflate
Accept:application/json, text/javascript, /; q=0.01
Code: Select all
Sent Cookie
tracking_id:542c74a9-ee3e-489c-9da9-e0c3f4cc09ccTIGGZI_REFERRER:appery.ioorg.jboss.seam.security.authtoken:P7LaQN9hG6XlT6rXQMmkOszjEZ4pE6OmP3CoEZ4pPMGmPZPXPMGpEYqtPcOrEYqoD3aqD3OpCZSuDZKrD3aqCJ8vJSESSIONIDSSO:BpAsqePUcwnngPvPTGhru2FtJSESSIONID:iowZZtLFObk+hGhxUS8x2rLrhellobar_current:1