-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CURL -c option not working properly #113
Comments
Hi Huachao, first of all thanks for developing this extension I found it very usefull. Just an observation hope its help. Options -c and -b works in pair. Typically -c is used while login to a service and -b is used in subsequent calls as session token from previous login. I read in your docs, that rest client "remember Cookies for subsequent requests", I tried this to workaround -b/-c problem but unfortunately I can't get it working as well. Thanks |
@drmistral -c option is currently not supported since as you know, my extension already saves received cookies in a file, and you can find the cookie file in Do you have any suggestions? |
@Huachao now I see, I supposed the extension was using libcurl.... Ok, In my case i could leave -c -b options and the extension cookie file, but the problem is that, for some unknown reason, this mechanism is not working with my java server.
At the moment I need to investigate more about why jsessionid is not linked from the received request. I'll let you know if I find why. My suggestions:
|
@drmistral I will document this, and can you check the cookie.json and whether the jsessionid stored in it? And I will first fix the bug in #112 |
@Huachao Yes, the jsessionid is stored in cookie.json when i do the login POST. |
@drmistral Can you show me the piece of related cookie and sample GET request |
Login call:
(Login OK) ~/.rest-client/cookie.json:
Query call
Last call behaves like unauthorized. |
@Huachao how the JSESSIONID is passed in subsequent request calls using the extension? |
@drmistral It seems that your cookie has an extra "/myapp-srv": {
"JSESSIONID": {
"key": "JSESSIONID",
"value": "8462FD1D6F2E7D3B10C6B2096010CAD2",
"domain": "httpbin.org",
"path": "/myapp-srv",
"httpOnly": true,
"hostOnly": true,
"creation": "2017-08-09T08:43:41.738Z",
"lastAccessed": "2017-08-11T09:59:37.087Z"
}
} |
@Huachao Correct! I tested removing the extra / directly from your cookie.json and it works! |
@drmistral I will also look into the request module I use why it behave like this, since cURL can handle as you wish |
@Huachao yes would be great, I checked that even using command line curl, in the response and saved cookie file there is the extra slash. Probably have to be removed in the subsequent calls. Response
File
|
@drmistral I also fixed the bug in my side, and in next release of this extension, you can still set the cookie path with trailing slash. And |
I've checked this issue removing the Tomcat parameter in order to check your change and it works! Thanks! |
Steps to Reproduce:
curl -i -c "/tmp/cookies.txt" "http://httpbin.org/cookies/set?k2=val2&k1=val1"
The text was updated successfully, but these errors were encountered: