Skip to main content

If you want to send a value of Cookies, its possible to configure the Headers option in transformer HTTPCaller:

Select in Name the option Cookie and in Value write the value from Cookie.

Thanks,

Danilo


You can also set the option 'Save Cookie' within the parameters to Yes.


You can use dev tools on chrome to figure out the cookie settings and then copy these into the HTTPCaller. The trick is to first enable dev tools, then view or authenticate with the website you wish to copy the cookie from.

To enable dev tools, go to Google Chrome, click on More Tools, select Developer Tools and click on the Network tab. Once this is set up, go to the web site you wish to copy the cookie from and log in as needed. Then in dev tools, click on the website URL at the top of the Name column and you should see the cookie element under 'Request Headers'. Add the Cookie and Accept request header elements to HTTPCaller and then copy the Cookie and Accept values over to the HTTPCaller header parameters. If you are using the cookie for authentication, you will likely need to disable the authentication section in the HTTPCaller as this may conflict with your cookie settings. You may need some other Accept elements (Accept-Language etc) so it might take a few tries to get all the header elements configured correctly. The basic idea is you are trying to get the HTTPCaller to mirror the request that the web browser is generating.

Here's a screenshot of the Dev Tools Network tab for safe.com cookie:

This is the HTTPCaller with the cookie copied over:


You can also set the option 'Save Cookie' within the parameters to Yes.

Thanks Trent and Danilo. Yes - there is a save cookie setting that is worth a try - sometimes that is all that is needed. Also if you already know the cookie value you can just insert it as Danilo pointed out. I posted my example because HTTPCaller is not a full web browser and so often cannot discover the cookie values on its own. If you find yourself in a situation where you don't know the cookie value or save cookies doesn't help, I wanted to point out an approach for how to copy these over from your browser.

 

 


@deanatsafe

Hi, I am currently having the same issue highlighted here. If I copy the cookie from Chrome dev tools to FME HTTPCaller header, it works.

However the cookie will expire, particularly as I will run my workspace once a week every week. How do I get a cookie generated for every call in HTTPcaller ?

I have tried Save Cookies option, but don't see any difference. The request fails when the cookie expires.


OK, I searched this question and found no useful answer, so I delved into my own case and share my experience here.

Basically I got a username and password combination for the login api to issue a cookie. With Postman I can see the cookie is in the response header. so in the first httpcaller, I List Attribnute For Response Headers to "_response_header". Then I exposed the "_response_header{5}.value" and get the cookie string out of it. The number in {} varies depending on your server response. Then it can be passed to the second httpcaller as header cookie.

One interesting finding is that the cookie expires immediately after the second httpcaller is run. so I have to run from the creator each time.

Hope this helps.

Cheers,

Song


Reply