Skip to main content
Solved

How to See the API Request Body Sent by HTTPCaller


ecx
Supporter
Forum|alt.badge.img+4
  • Supporter

Hello,

I have a API request working in postman, but cant get it to work via FME. 

If I could see the request headers/body, etc I would be able to debug the issue by comparing the working request vs the fme request.

Does anyone have any ideas how I can see this?


Thanks

Best answer by jkr_wrk

You can change the requested URL in the HTTPCaller to this URL:

https://postman-echo.com/get

or POST etc.

This will give back what FME send as JSON file. And you can analyse this to see if FME did something unexpected.

View original
Did this help you find an answer to your question?

3 replies

jkr_wrk
Influencer
Forum|alt.badge.img+29
  • Best Answer
  • July 23, 2024

You can change the requested URL in the HTTPCaller to this URL:

https://postman-echo.com/get

or POST etc.

This will give back what FME send as JSON file. And you can analyse this to see if FME did something unexpected.


birgit
Influencer
Forum|alt.badge.img+16
  • Influencer
  • July 23, 2024

Hi exc,

This is indeed a problem with the http caller transformer. Are you able to share the call you are trying to make or is it sensitive information? What i usually do is try to send the most barebones call to the API that should work and check the response. Usually I hope to get a not authorized page, if I don't then I try to tweak the url and the headers. Then I add my authorization, and then I add the body that contains information that the API call needs to function.

What I do this way is 1: check if my url is correct, 2: check if the authorization is correct and 3: check if the body layout is correct. This way you can sort of find where you have a problem. 

I hope this helps you a little bit with tracking down your problem.


gistoddt1
Participant
Forum|alt.badge.img+1
  • Participant
  • October 24, 2024

I was typing out this follow up question to jkr_wrk:

Can you please elaborate on this?

** It will give back what FME sent as a JSON “file”? **
Where do I find that file? When doing this, I do not find any difference to what is in the Transaction Log.

However, I then noticed I got an Output result, rather than a <Rejected> result.  The Output _response_body field (default) has the header info in it.

 

This allowed me to determine that the FME web connection stores an obtained access token in the variable named [TOKEN].

This was very helpful in determining how to configure API Call Parameter-Header Format for a custom web service based on the Token template:

     Authorization: Bearer [TOKEN]


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings