You need to sign in to do that
Don't have an account?
PRABHAKARAN V 5
I am trying to send JSON data and File data from the content version to REST callout using the content type "Multipart/form-data" with boundary in the APEX class. But, I am getting "Bad-Request" as the response Status and "400" as the response code. If I
Hi,
I am trying to send JSON data and File data from the content version to REST callout using the content type "Multipart/form-data" with boundary in the APEX class. But, I am getting "Bad-Request" as the response Status and "400" as the response code.
If I send the same JSON data and file data to the REST callout using the "POSTMAN " tool, I receive a successful response.
Is there any other way to send JSON and file data in REST callout or any other body format needed for multipart/ form-data content type?
example of my body format:
------Boundary
Content-Disposition: form-data; name="jsondata"
Content-Type: application/json
{"id":"123","name":"test"}
-----Boundary
Content-Disposition: form-data; name="file"; filename="test.pdf"
Content-Type: application/pdf
file data
-----Boundary
regards,
prabhakaran
I am trying to send JSON data and File data from the content version to REST callout using the content type "Multipart/form-data" with boundary in the APEX class. But, I am getting "Bad-Request" as the response Status and "400" as the response code.
If I send the same JSON data and file data to the REST callout using the "POSTMAN " tool, I receive a successful response.
Is there any other way to send JSON and file data in REST callout or any other body format needed for multipart/ form-data content type?
example of my body format:
------Boundary
Content-Disposition: form-data; name="jsondata"
Content-Type: application/json
{"id":"123","name":"test"}
-----Boundary
Content-Disposition: form-data; name="file"; filename="test.pdf"
Content-Type: application/pdf
file data
-----Boundary
regards,
prabhakaran
Can you also include your apex code. Recommend reviewing this similar post from past
https://salesforce.stackexchange.com/questions/179814/salesforce-apex-posting-multipart-form-data-content-type