Page 1 of 2

Cookie using PUT method for a REST service

Posted: Thu May 23, 2013 10:44 pm
by rk dudi

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.


Cookie using PUT method for a REST service

Posted: Thu May 23, 2013 11:13 pm
by maxkatz

Can you show how is your service setup?


Cookie using PUT method for a REST service

Posted: Fri May 24, 2013 12:06 am
by rk dudi

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.


Cookie using PUT method for a REST service

Posted: Fri May 24, 2013 12:32 am
by maxkatz

When you do Test from service it works but when you run from the page (via proxy) it doesn't work?


Cookie using PUT method for a REST service

Posted: Fri May 24, 2013 1:20 am
by rk dudi

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.


Cookie using PUT method for a REST service

Posted: Fri May 24, 2013 1:23 am
by maxkatz

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.

http://docs.appery.io/documentation/a...


Cookie using PUT method for a REST service

Posted: Fri May 24, 2013 1:45 am
by rk dudi

is it possible for you to take a look to see if I'm doing something wrong.


Cookie using PUT method for a REST service

Posted: Fri May 24, 2013 1:46 am
by rk dudi

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.


Cookie using PUT method for a REST service

Posted: Fri May 24, 2013 2:22 am
by Illya Stepanov

Hi - Do you tested it with Chrome +security desabled setting - "chrome –disable-web-security"? Were there any errors?


Cookie using PUT method for a REST service

Posted: Fri May 24, 2013 2:24 am
by rk dudi

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