oblac / jodd

Jodd! Lightweight. Java. Zero dependencies. Use what you like.

Home Page:https://jodd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HttpRequest.cookies Only one method is provided, Is so silly

yesmyyyd opened this issue · comments

HttpRequest.cookies
I'm going to assign a random cookie string, but the author only provides one method
Support for arrays and strings is recommended

Do you really think this kind of rude language is appropriate when asking the developer of a software you use for free to help you?

Maybe it's just lost in translation :) Will try to add it something more user friendly

Maybe it's just lost in translation :)

I am pretty sure it is. Google Translate most likely.

Though, @igr, I am not sure there is any problem with cookies() you'd need to fix. It works just beautifully.

@igr @neroux
haha,my english is not good.

The problem has been solved satisfactorily at last
I used “okhttp”
image

Which problem? There was no problem to begin with.

I don't see a problem, just room for improvement - instead of passing the array of Cookies, we might have cookies() that return some sort of collection of cookies and then add/remove using api.

@yesmyyyd
You can do the same with header() in Jodd. Not sure what you mean by that?

@igr
You can do the same with header() in Jodd.
maybe i didn't find it.

There are at least 3-4 different header methods in Jodd :))) @yesmyyyd

I see. thank you @igr

@yesmyyyd : if there is no problem in Jodd (anymore) - close issue, please. Thx!

I don't see a problem, just room for improvement - instead of passing the array of Cookies, we might have cookies() that return some sort of collection of cookies and then add/remove using api.

There's always room for improvement for just about everything 😃 Personally I believe the current approach works just fine.

One possible "improvement" could be to use a HashSet instead of an array and extend Cookie to hash and equal based on its name, which would allow for easily adding and removing cookies from that hash set with standard calls.

Whether thats necessary is a different subject and IMHO it shouldnt replace the current array approach via cookies() as that would break existing code.

But again, this entire discussion started off of a wrong premise :)