C
C#Adel

❔ 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 😊
J
Jimmacleβ€’383d ago
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.
A
Adelβ€’383d ago
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
M
mr_technocalβ€’383d ago
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.
A
Angiusβ€’383d ago
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
A
Adelβ€’383d ago
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 πŸ™‚πŸ™‚
A
Accordβ€’375d ago
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.
Want results from more Discord servers?
Add your server
More Posts
βœ… How to get the form style of a processI need to get the form style of a process❔ Can i develop a discord music bot or admin bot using C#?If i can, how? Any idea?❔ Console inputHi, is it possible to enable console input in web sdk using Host? ```csharp public static as❔ MediaPlayer in WPF occasionally fails```cs public static void PlaySound(string path) { Task.Run(() => ❔ How to Create a C# Code Base for a PC CleanerDoes anyone know of C# to make a base code that for now just clean the %temp% folder just for me to βœ… How to install a callback for an awaited item when using Task.WhenAllHello I am using Task.WhenAll on a List of Tasks. However if a task fails I want to immediately call❔ How to get azure cache for Redis connection string stored in app service as a appsetting variableI have created a azure redis for cache and stored the connection string as application setting varia❔ Giveaway for an online DOTNET ConferenceHello developer students, I am going to give away free tickets to an online dotnet conference whic❔ SoundBoardHi! I am working on a soundboard lately and i got stuck with playing a sound throught microphone. i'❔ accessing object from a class inside of another classI got this class called "Engine"(image 1) that has the object "isOn" which indicates whether the eng❔ QuestionControllerHello, i have a question regarding API structure. I have two classses, Item and Store. I created C❔ Problem Binding to Image SizeI am making an app that displays a series of books. An image and title of the book is to be displaye❔ whats the best site or youtube channel to start learning c#?just downloaded visual studio and wanted to know what would be the best way to learn C#❔ C# MVC - Erroring in VSC not VS2022I'm writing a C# .Net Core 7.0 web application with dapper for my SQL queries. It runs just fine inString Contain issueSo im trying to get a word in a string using Contain but its not getting the word, I havent found a ❔ Catching Exceptions with generic parameters?When adding an entity to the database, i first check if it already exists and if it does I throw an ❔ How should I learn programming?I'm sure this is a common question, but I want to learn game development but am a pretty new C# prog❔ How to properly structure projects in a multi-app MVVM solution?I tend to structure my MVVM projects in the following way: ``` . β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ Applications/ β”‚ Sending File and Data to a Minimal API endpointHi. I am using .NET 7, Minimal API and Mailkit. What I want to do is to send an attachment along wi❔ reprotucing the kings pathcan anybody help me fix this code https://paste.mod.gg/sgsvrbaqnmpi/0 ``` the input is number of obs