Trying to POST form-data in API request
![lowielowie](https://us.v-cdn.net/6037124/uploads/userpics/XJBBKWC966L2/nI0W3J2BTQV90.png)
Hi,
I'm trying to POST form-data to another API (using a webhook/Xano Endpoint URL) but I can't seem to send data in curl as '—form' data.
Here's the external API request:
Here's the request logged (output):
It seems the headers are not set, while I did use the 'Import CURL' function to map all the fields correctly. When I use Postman to do the same request it works without any problems. It seems to be a problem with the fact that the body needs to send 'form-data' but I don't see that option in Xano.
Here's my Xano API settings:
Best Answer
-
Could it be possible there's an extra space at the beginning or end of your URL?
Answers
-
Multipart/form-data is typically used for file uploads, which is probably why you're not having success.
I would first reference the API documentation from the API provider you're using. My guess is you'll probably have better luck with application/json or application/www-x-form-urlencoded. But please reference the API documentation, this will be your best resource.
-
Hi Michael,
Thanks for you reply. The API I'm using is Manatal (
)The following call should be made to successfully do a POST:
-
@lowielowie - I'm now noticing your response is "false" which typically means either the server is failing to respond or there could be a typo or extra space in the URL of the API call
-
Hi Michael, you're right. There was a space in my endpoint URL…
Perhaps Xano could trim it at all times? It's really hard to see.
Thanks for your help.
-
I hear you, the difficulty here though is your URL is coming from a variable - trimming all variables automatically probably wouldn't make sense for every use case
-
Hi Michael,
That's true. You could create something like a warning message though informing users there's a space in the variable.
I got it up and working now, great tool.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback