-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/posts/{post-id} PUT end point returns error: 5002, multipart/form-data content is invalid #87
Comments
For better understanding, I summarized my multipart form request.
|
Will you try making media an object instead of an array of objects? I see {
"media": [
{
"height": 1920,
"identifier": "randomstring",
"type": "image\/jpeg",
"width": 1080
}
],
} expected: {
"media": {
"height": 1920,
"identifier": "randomstring",
"type": "image\/jpeg",
"width": 1080
}
} |
Hi @sirreal , I tried. But the result is not different. The same error(code:5002, multipart/form-data content is invalid) is returned. BTW, all the image requests( POST method for creating post) are successful with the media object instead of array. Is it reliable? |
I tested this out and it seems to be working correctly with PUT for NPF edits. Here's what a working request looks like for me:
|
@sirreal , I have tried exactly the same as yours, but, unfortunately, the result never changes. Whenever I make any change, the response is always '400 bad request, code:5002, multipart/form-data content is invalid'. |
this sounds like a bug in your HTTP library or client code then,
unfortunately
…On Mon, Sep 18, 2023, 7:07 PM Ben ***@***.***> wrote:
@sirreal <https://github.com/sirreal> , I have tried exactly the same as
yours, but, unfortunately, the result never changes. Whenever I make any
change, the response is always '400 bad request, code:5002,
multipart/form-data content is invalid'.
—
Reply to this email directly, view it on GitHub
<#87 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABZCV2WGBGSMVPN46ZZNADX3DO3XANCNFSM5YBCPE7Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hi @nightpool , @sirreal , I know that the 'api-http2.tumblr.com' endpoint used by the official app works well for PUT/multipart. However, the 'api.tumblr.com' endpoint used by third-party developers seems to work a little differently. After running into this issue, I searched 'put multipart/form-data' on Google and came across many reports that some web server libraries had problems supporting files in the put method (especially on stackoverflow), so I asked you here to check if the PUT/multipart function is working properly. However, since @sirreal 's test says it works normally, I'm not sure what I should look into further. |
When posting to /posts/{post-id} end point using PUT method and npf format, multipart/form-data fails with the follwing error.
When posting to /posts end point to create a new post with images via multipart form content type, no problem occurs. Multi part form works correctly and posting succeeds.
When posting to /posts/{post-id} end point without multi part form(in other words, with the application/json content type), it works normally. Editing a post succeeds.
But if I add a new image when editing a post and post with the multi part form, it fails with the error message "multipart/form-data content is invalid".
Does "PUT /posts/{post-id} end point" support multi part form?
The text was updated successfully, but these errors were encountered: