Skip to main content
Question

How to send form data through httpcaller transfomer?


Hi,

In Postman:

I have setup a POST request to https://xxx.com/login

In Body as form-data or x-www-form-urlencoded

username:user@test.com

password:Test123

And I get my response back OK

 

In my httpcaller I am setup like this :

attribute_creator_loginhttpcaller_configBut now I got a server error, just like my request is malformatted, as you see I even tried to put the form data into a specific attribute instead of passing directly inside the httpcaller. I got a feeling that fme httpcaller is having a problem with the "@" in the username, because in cURL I would put username in double quote to make it work just like :

 

curl -X POST -F "username=user@test.com" -F "password=Test123" "https://xxx.com/login"

 

What am I doing wrong there?

 

6 replies

todd_davis
Influencer
Forum|alt.badge.img+22
  • Influencer
  • April 18, 2023

If it is form data you need to send. The easiest way is to change the "upload data" to "Multipart/Form Data" in the httpcallerimageSee how you get on.

 

Cheers,

Todd

 


Didn’t work either, but mocking the Api under Postman it worked, can’t figure out what is going wrong…!


todd_davis
Influencer
Forum|alt.badge.img+22
  • Influencer
  • April 18, 2023

Hi,

 

Based on your curl input. In FME it will look like this.

 

image


todd_davis
Influencer
Forum|alt.badge.img+22
  • Influencer
  • April 18, 2023

Well I didn't put in the full request url. Missed the login bit.


Exactly what I did but except for my mock API under Postman it is not working for the production environment :(


danminneyatsaf
Safer
Forum|alt.badge.img+12

@newsafeuser​ you could try using the Use Authentication parameter at the bottom of the HTTPCaller as opposed to using an Upload Body. This will allow you to define a username and password. Let us know if this ends up working for you.

image


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