β Http post
Hello guys My issue is when I click submit I get
This page isnβt working right now
If the problem continues, contact the site owner.
HTTP ERROR 415
Wasnt sure if my code wasn't correct wanted to ask
Thank you π
6 Replies
415 Unsupported Media Type - HTTP | MDN
The HTTP 415 Unsupported Media Type client error response
code indicates that the server refuses to accept the request because the payload format
is in an unsupported format.
I saw that but didn't know what's unsupported the only thing maybe is my image
But my form is only taking title as an input just to test
Image on visual style is byte while on sql it's varbinary
415 means the client sent content that the server doesn't support. What did the client send? APIs typically only support
application/json
. This appears to be a UI controller. In order for a HTML form to post a file to the server, it must be a multipart, MIME encoded document. This is required because the first part is the input form values and the second part is the actual file content. These are completely different media types. The server needs to know how to handle that.Screenshot of a screenshot has to be a new low in posting code
If you're sending a form, you want a
[FromForm]
attribute
[FromBody]
handles the application/json
media type
You're sending x-form-urlencoded
Sorry about that
I think the error is coming from the frombody cause it's changing it to json
So should I change it to x-form or fromfoem
Thank you for your help ππ
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.