Skip to content
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

Support cookies in code snippets #4327

Open
purefan opened this issue Mar 13, 2018 · 10 comments
Open

Support cookies in code snippets #4327

purefan opened this issue Mar 13, 2018 · 10 comments

Comments

@purefan
Copy link

purefan commented Mar 13, 2018

App Details:

Postman for Linux
Version 6.0.9
linux 4.13.0-36-generic / x64

Issue Report:

  1. Did you encounter this recently, or has this bug always been there:

Always there

  1. Expected behaviour:

Clicking on code and copying the cURL snippet would work if run directly in a terminal (same with the other exporting options -> nodejs/etc)

  1. Console logs (http://blog.getpostman.com/2014/01/27/enabling-chrome-developer-tools-inside-postman/ for the Chrome App, View->Toggle Dev Tools for the Mac app):
  2. Screenshots (if applicable)

Steps to reproduce the problem

From within Postman, query an endpoint that returns a Set-Cookie header.
Postman will save these cookies and you can see them if you click on Cookies.
Send a request to an endpoint that requires these cookies, but in your headers list do not add a Cookie header. The request works.

Click on Code, the code generated does not include the cookies sent.

Apparently the Code generator only takes the params from the request tab, but Postman sends cookies regardless of the entry not existing in the headers tab. I was able to confirm this behavior by filtering traffic in wireshark.

If I dont add a cookie header, I dont want Postman to send cookies.

@purefan purefan changed the title Copy Code does not include cookies Copy Code does not include cookies / Postman sends hidden cookies Mar 13, 2018
@sivcan
Copy link
Member

sivcan commented Mar 28, 2018

Hi @purefan Thanks for reporting this. We'll look into it and get back to you.

@harryi3t harryi3t changed the title Copy Code does not include cookies / Postman sends hidden cookies Supoport cookies in code snippets Apr 3, 2018
@harryi3t harryi3t changed the title Supoport cookies in code snippets Support cookies in code snippets Apr 3, 2018
@nlwillia
Copy link

I was just poking around in the native app to see if it made any difference for #1228. I was pleased to see that there's now an option to manage cookies, but surprised that there doesn't seem to be any way to manipulate them in the snippet API. For cases where cookies are unwanted, being able to add something to the pre-request script would be perfect.

@siddharthlatest
Copy link

Seconding the original request here. Another use-case is when creating docs via Postman where OAuth session info is stored in a cookie. Being able to publish examples for those that include the cookie name=value would be great.

@DanH42
Copy link

DanH42 commented Jun 5, 2018

Honestly, I would call this a bug, not a feature request. I just wasted a bunch of time trying to troubleshoot a nonexistent issue because the generated cURL snippet does not replicate the request sent by Postman, and I was assuming that they would be identical (why else would this functionality exist?). I can't find a single place in Postman where it shows the actual, complete request it's really sending to the server once cookies get involved. If #1228 is going to keep sitting around unresolved, please at least show the user the actual request being sent.

@omaric
Copy link

omaric commented Aug 25, 2018

At the very least, a message in the GENERATE CODE SNIPPETS window that says "cookies are not generated" would've saved me several minutes of wondering if the cookies weren't being sent because I had the wrong domain/path.

@b-fuze
Copy link

b-fuze commented Feb 14, 2019

This would be very helpful, I'm testing APIs that require cookies and had to include them into the command manually

@jonnyijapan
Copy link

Please fix this

@Bluscream
Copy link

YES PLEASE!

@ncremaschini
Copy link

This should be a must have...

@Akkarine
Copy link

Akkarine commented Jul 28, 2022

upvote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests