Kong / unirest-java

Unirest in Java: Simplified, lightweight HTTP client library.
http://kong.github.io/unirest-java/
MIT License
2.59k stars 593 forks source link

add ability to set a collection of cookies #358

Closed Nafanya123 closed 4 years ago

Nafanya123 commented 4 years ago

hello, can you add in Unirest support Array Cookies? kong.unirest.Cookies

Unirest.get("https://www.site.com/").cookies(new kong.unirest.Cookies())

Thanks,,

ryber commented 4 years ago

The Cookies object is mostly for reading the cookies. What would be the point of setting it? Unirest already has a cookie policy to send back the same cookies returned from the requesting server.

Nafanya123 commented 4 years ago

Sometimes an HTTP request does not work without cookies, and there may be more than 5 such cookies, and each time a new HTTP request is needed, it looks rather cumbersome, and therefore it would be easier to do this by headers analogy

ryber commented 4 years ago

So you don’t want to set a Cookies object you want to set more than 1 cookie at once, as a collection. These are not cookies that the server returned and so would be part of the policy on the domain?

ryber commented 4 years ago

Complete is 3.8.00