The postman works in the below format to upload an attachment.
set method type to POST.
Then select Body -> form-data -> Enter your parameter name
and on right side next to value column, there will be dropdown "text, file", select File. choose your image file and post it:
I succeed with form-data, how do achieve via RAW text or Json because the image which is uploaded is dynamic.The image and txt file is stored in my local.
I am trying to upload png and .txt file to JIRA Rest endpoint(Subtask). My goal is create subtask, once subtask is created add attachment to it, attachment can be dynamic.
curl -X POST \
https://host/rest/api/3/issue/pos-14108/attachments \
-H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-H 'Postman-Token: c2b02ef1-4b81-4e8e-bb02-fb697bb2680e,1c20aa55-27c5-44c3-9f08-7efc41f25576' \
-H 'X-Atlassian-Token: no-check' \
-H 'cache-control: no-cache,no-cache' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F file=@/Users/nmane/Desktop/harry.png