Start a new topic
Answered

How send file with http.rest module

 

Hello, 
I would like to send a file via the http.rest module. Do you have a resource on the subject? Thanks


Best Answer

Hello @abeguin and thanks for reaching our Forum!
You can follow this detailed solution:
How to use POST multipart/form-data API in mapping

Thanks 


Answer

Hello @abeguin and thanks for reaching our Forum!
You can follow this detailed solution:
How to use POST multipart/form-data API in mapping

Thanks 

Hi,


Thanks for your response.


I want to send in the input parameter a png file.


I use put method with basic auth.


I succeeded with Postman.


this the cURL code generate by postman :

 

PUT /wiki/rest/api/content/19234839/child/attachment HTTP/1.1
Host: {{mydomain}}
X-Atlassian-Token: nocheck
Authorization: Basic {{token}}
Content-Length: 205
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="filename.png"
Content-Type: image/png

(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW--

 

 And http code generate by postman :

curl --location --request PUT "https://{{mydomain}}/wiki/rest/api/content/19234839/child/attachment" --header "X-Atlassian-Token: nocheck" --header "Authorization: Basic {{token}}" --form "file=@\"filename.png\""

 Best regards,

Hi,


Can you detail furthermore your action?

- you want to send http in the input parameter of the API, or to send a file in the response

- what is the file format,

- which method (get, post...), 

- is there authentication,


Did you have already a test case in Postman for example?


Best regards,

 

 

 

 

 

 

Login to post a comment