Hey everyone,
I need to consume a Rest API with PUT method and having Request Format as Multipart/form-data. Since Outsystems does not support PUT with Multipart/form-data, how will I be able to consume the API without modifying exposed API itself.
Error Says-
Hello, perhaps this forge component can help you: https://www.outsystems.com/forge/component-overview/4026/multipart-form-data-o11
Hello @Magnus, Thanks for you reply.
Forge component- multipart-form-data-o11 changes the Request Format of consumed API to Binary, but I need Multipart/form-data. I tried this solution but that would require some modification in exposed API which unfortunately cannot be done. Any other solution would be appreciated. Thanks
Hi Saurabh,
I think you are mistaken. There is no "binary" Request Format. The OutSystems multipart/form-data functionality is based on the functionality from the Forge asset, and it works largely the same. It is true that you cannot use PUT with the native functionality, unfortunately, but the Forge asset should work just fine.
If you are having trouble getting it to work, I'd ask you to post in the Forge asset's subforum.
I am experiencing the same issue. I am using `MultipartFormDataCreate` to prepare a request for uploading a file via a POST API request. While it works for POST requests, it does not work for PUT requests.
Hi Anis,
Just to make sure: are you using the platform-native functionality, or are you using the Forge asset?
Thanks for your reply , i'am using the forge asset
Ok, then it's simple: the Forge asset does not in any way need POST or PUT, it just creates the body of the request. If it doesn't work for PUT requests, the data you sent is wrong. Do you get a specific error message from the API you are calling?
I do the same thing as Post, which works. I tested with Postman the API works fine, but the response: File is required . It's like the file is missing when I try to do the put.
You will agree with me that if the code path before deciding to call either PUT or POST is the same, and from your image it seems the are, it's impossible for the PUT to have a different payload than POST.
it's the same payload for both , it's just the request method that change!
Well, then it must be that the API expects a different content when using the PUT than when using the POST.
nope it's the same! it's really wierd
That is indeed very weird. Have you also checked all the parameters of the POST and PUT call, any On Before Request, etc. to see if both methods are completely identical (except for the POST/PUT of course)?