0

I'm testing a simple Postman POST. I have an URL, POST; and I attach a file using "binary" under "Body" section. This is the only option (under Body) that allows me to simply browse a file and attach it to the request.

Without header:

415 Unsuported Media Type

When adding the header:

500 org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found


In contrast, with curl, it works like a charm:
```bash
$ curl -sS -u llagos:*** -F "file=@i.png" -X POST http://osbdev/rest/api/2/issue/DVMG-1/attachments

What am I doing wrong; it's always me :(

Thanks a bunch!

realr
  • 3,652
  • 6
  • 23
  • 34
Leo Lagos
  • 45
  • 7
  • Did you ever find a solution? I am encountering a similar situation, and am wondering if Curl's local file upload somehow works differently. – Mike Jul 09 '20 at 20:25
  • never did... I left that company a while after, but as far as I recall, no solution was found. Curl worked ok, postman no. – Leo Lagos Jul 10 '20 at 21:05

1 Answers1

1

Actually, you can also attach a file in form-data (in the KEY column you can choose File and then click on the Select Files in the VALUE column and attach it. Regarding the multipart boundary, that question has been answered before, some interesting reading can be found here: What is the boundary in multipart/form-data?

Ove Larsson
  • 161
  • 6
  • Thanks! I just tried it and even though i receive a 200 OK return code, the file was not attached... I'll into the server side. Regards, – Leo Lagos Aug 07 '19 at 18:43