Skip to main content
Solved

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

  • May 23, 2023
  • 4 replies
  • 195 views

juanmahere
Supporter
Forum|alt.badge.img+13

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

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • 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+13
  • Author
  • Supporter
  • 47 replies
  • 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+63
  • Celebrity
  • 1625 replies
  • 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
  • 46 replies
  • 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