β 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.We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
51KMembers
View on DiscordWant results from more Discord servers?
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