Skip to main content
Solved

HttpCaller - POST - How to add UserName and Password within BODY


juanmahere
Supporter
Forum|alt.badge.img+12

Hi FME lovers,

I'm getting blocked when trying to access this website, via POST:

https://lastkajen.trafikverket.se/api/Identity/Login

 

Using HttpCaller from FME 2022.2, I have:

HttpCaller settingsBut, no luck, a http_status_code = '400' is sent.

 

On the other hand, I've had no issues using Postman:

 

postman 

I guess I'm not filling well the HttpCaller settings, right?

 

Thanks!

Best answer by nielsgerrits

I think the body in the HTTPCaller is incorrect. Try

UserName=xxx&Password=xxx

 

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

4 replies

nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • May 23, 2023

I think the body in the HTTPCaller is incorrect. Try

UserName=xxx&Password=xxx

 


juanmahere
Supporter
Forum|alt.badge.img+12
  • Author
  • Supporter
  • May 23, 2023

Thanks @nielsgerrits​  for your quick reply,

I've tested with:

  • UserName=XXX&Password=XXX

and works perfectly, thanks for the tip!! ;)

 


hkingsbury
Celebrity
Forum|alt.badge.img+55
  • Celebrity
  • May 23, 2023

To build on @nielsgerrits​ response, it looks like the API your using requires the input encoded as a form (which is what Niels gave you). What you initially had is JSON, so for some APIs, JSON encoding is valid (you'd need to make sure you set the content type to JSON in those cases)


nordpil
Supporter
Forum|alt.badge.img+11
  • Supporter
  • July 15, 2024

FYI - I created a web connection and published to the hub for authorization for this service:

https://hub.safe.com/publishers/nordpil/web-connections/trafikverket-lastkajen-api


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