Skip to main content
Solved

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


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!

4 replies

Badge +41

I think the body in the HTTPCaller is incorrect. Try

UserName=xxx&Password=xxx

 

Userlevel 1
Badge +11

Thanks @nielsgerrits​  for your quick reply,

I've tested with:

  • UserName=XXX&Password=XXX

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

 

Userlevel 6
Badge +39

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)

Userlevel 1
Badge +7

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

Reply