This conversation has been locked due to inactivity. Please create a new post.
This conversation has been locked due to inactivity. Please create a new post.
Hi team,
How to fetch header "login-token" from response in java programmatically?
Thank you.
Solved! Go to Solution.
Views
Replies
Total Likes
Thanks for the prompt reply Arun,
I have done that but not able to find the cookie "login-token" from response.
I am trying to hit Assets api using java code with access token .. getting 401 unauthorised, But in postman I am able to fetch api because In the header field login-token cookie is there in postman.
even when hitting assets api with basic auth also getting 401 unauthorised.
@sriram_1 hi,
If you are using java.net.URLConnection, you can use :
conn.getHeaderField("login-token");
If you are using Apache HTTPClient , you can use :
response.getFirstHeader("login-token").getValue();
Thanks,
Milind
Hi miland,
I have used the same but there is no header field named "login-token" in response.