3 ms·
I use cURL for local development with JSON cookies and I think it's perfectly adequate for that purpose. curl --insecure --cookie test_cookie='{"test":"bob"}'
by Zamicol 5y ago
I use cURL for local development with JSON cookies and I think it's perfectly adequate for that purpose.
curl --insecure --cookie test_cookie='{"test":"bob"}' https://localhost:8081/ https://localhost:8081/
- pbiggar 5y agoYou forgot `-H "Content-type: application/json; charset=utf-8"`
- edoceo 5y agoNo charset on this mime type.
- pbiggar 5y agoTIL! Seems to be a quite confused topic as many things (it seems for example some java servers) even require it, but you do seem to be right, as JSON must always be utf8.
- Zamicol 5y ago--cookie puts the value of the cookie in the header. Host: localhost:8081 Accept: / Cookie: test_cookie={"test":"bob"} User-Agent: curl/7.74.0
- MrStonedOne 5y ago
- mdoms 5y agoGood news, you can keep doing it that way.
- svnpenn 5y agoI think its bad practice to only quote part of the argument like that.
- Zamicol 5y agoI agree. The quote at the beginning is better for multiple cookies: curl --insecure --cookie 'test_cookie={"test":"bob"};test_cookie2={"test2":"bob"}' https://localhost:8081/ https://localhost:8081/