How to pass cookie value as string instead of Map<String, String> in JSOUP?

Viewed 25

I wish to pass cookie value found in developer console as string programmatically using Jsoup.

I know below way to pass cookie in JSOUP

.cookies(login.cookies())

the value type is Map<String, String> var1

But I wish to string as below, how to achieve it ?

 -H 'Cookie: currency=INR; magnitude=LC; ad=3d468...' \
        -H 'Referer: https://www.valueresearchonline.com/funds/26123/motilal-oswal-flexi-cap-fund-regular-plan/' \

enter image description here

1 Answers

As you can see on your screenshot, cookies string is sent as a header named Cookie.
If you already have the correct value you can set this header directly:

.header("Cookie", "currency=INR; magnitude=LC; ad=3d4686659c9...")
Related