cancel
Showing results for 
Search instead for 
Did you mean: 

Request is sent to another URL, how to handle cookies for this redirection?

Occasional Contributor

Request is sent to another URL, how to handle cookies for this redirection?

Hi,

 

using Soap UI 5.5 I have endpoint + resourse, but when sending the request, the RAW information shows totally different URL

As I see from the log, there is redirection and another URL needs cookie received from the first call. How to handle such requests? Now I've got  http 403

Tested the same in Postman - request is sent correct and has http 200

9 REPLIES 9
Community Hero

Re: Request is sent to another URL, how to handle cookies for this redirection?

Afaik, SoapUI doesn't know how to handle cookies when there are multiple hosts involved. Another possibility would be to disable automatic redirects for this request and handle the cookies yourself (extract the set cookie value and then use it in the subsequent requests).



If my answer helped please click on the 'Accept as Solution' button.
Occasional Contributor

Re: Request is sent to another URL, how to handle cookies for this redirection?

Thank you, @Lucian!

How can I disable automatic redirects? I haven't found any setting for that. Thanks!

Community Hero

Re: Request is sent to another URL, how to handle cookies for this redirection?

You can click on the http request and then you'll have a little space with some settings on the bottom of the screen (see the picture below)

 

2019-06-03_11h51_01.png



If my answer helped please click on the 'Accept as Solution' button.
Occasional Contributor

Re: Request is sent to another URL, how to handle cookies for this redirection?

wow, thank you @Lucian ! I'll try!

Community Hero

Re: Request is sent to another URL, how to handle cookies for this redirection?

Smiley Very Happy



If my answer helped please click on the 'Accept as Solution' button.
Occasional Contributor

Re: Request is sent to another URL, how to handle cookies for this redirection?

Actually that does not help because cookie is received somewehere during redirects Smiley Sad

Community Hero

Re: Request is sent to another URL, how to handle cookies for this redirection?

That's why I proposed for you to disable the automatic redirects.



If my answer helped please click on the 'Accept as Solution' button.
Occasional Contributor

Re: Request is sent to another URL, how to handle cookies for this redirection?

Yes, I've disabled it, but I do not know on which step I can get a cookie.

Community Hero

Re: Request is sent to another URL, how to handle cookies for this redirection?

Well that should be quite simple, isn't it?

 

You start by making the first request (the one for which the redirects were handled automatically). That request should either have a Set-Cookie header right away or just a redirect location (thus a Location header). If you're just getting a Location header then create a new request to that location (don't forget to disable the redirects for that request as well).

 

Next off, if your redirect request still doesn't have a Set-Cookie header, you might want to repeat the steps above, so take the Location header again, create a new request etc. You might encounter multiple redirects until you finish off landing on some page.

 

Let me know how it goes for you Smiley Very Happy



If my answer helped please click on the 'Accept as Solution' button.
New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors