This is the error response i get..
"{ statusCode: 400 message: "At least one attachment file must be included." }".
I know the HTTP POST message is well formatted as a multipart/form-data, any suggestions what might be missing
Well yes, I dowloaded curl, tried the examples from the documentation and compared the requests in Fiddler. The main difference was actually that the Content-Disposition name in the multipart must be "File". Apart from that I actually ended up building the multi part my self
So the request that worked for me became:
POST https://<mywiki>.atlassian.net/wiki/rest/api/content/<pageid>/child/attachment HTTP/1.1 X-Atlassian-Token: nocheck Accept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml Content-Type: multipart/form-data; boundary=-----------------------------28947758029299 Host: <mywiki>.atlassian.net Cookie: studio.crowd.tokenkey=<myvalue> Content-Length: 40797 Accept-Encoding: gzip, deflate -------------------------------28947758029299 Content-Disposition: form-data; name="File"; filename="<filename>.png" Content-Type: application/octet-stream PNG <Removed for readability> -------------------------------28947758029299--
I have the same issue, did you solve it?
My request is looking like this (with the actual values in the <tokens>
POST https://<mywiki>.atlassian.net/wiki/rest/api/content/<pageid>/child/attachment HTTP/1.1 X-Atlassian-Token: nocheck Accept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml User-Agent: RestSharp/105.2.3.0 Content-Type: multipart/form-data; boundary=-----------------------------28947758029299 Host: <mywiki>.atlassian.net Cookie: studio.crowd.tokenkey=<myvalue> Content-Length: 40797 Accept-Encoding: gzip, deflate -------------------------------28947758029299 Content-Disposition: form-data; name="<filename>.png"; filename="<filename>.png" Content-Type: application/octet-stream PNG <Removed for readability> -------------------------------28947758029299--
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.