C
C#9mo ago
khauvannam

❔ I want to create post which contain image and still stuck in this shit 3 days, help me :((

I have tested in postman but it always return 415 error
No description
No description
No description
No description
No description
No description
18 Replies
substitute
substitute9mo ago
Your postman request is sending Content while you expect PostContent That's the only thing that immediately stands out.
khauvannam
khauvannam9mo ago
Im in the road so when i go home, i will check it again, thanks u
substitute
substitute9mo ago
also postman is using this URI
substitute
substitute9mo ago
No description
substitute
substitute9mo ago
No description
substitute
substitute9mo ago
the only route I see that accepts POST is on / but it's a little hard to tell with the collection of screenshots
khauvannam
khauvannam9mo ago
i forgot to screenshot the mapgroup
No description
khauvannam
khauvannam9mo ago
it still return that shitting error :(((
No description
khauvannam
khauvannam9mo ago
can i give you my github project link so you can fork it and help me :((
substitute
substitute9mo ago
like 95% of what I work on is C++. I only use C# when it's a requirement.
khauvannam
khauvannam9mo ago
i still learning but this is first time i can not fix the error when i try so hard to search in everything
khauvannam
khauvannam9mo ago
https://github.com/khauvannam/BlogProject.Server.git if you see any error, please help me fix it ;((
GitHub
GitHub - khauvannam/BlogProject.Server
Contribute to khauvannam/BlogProject.Server development by creating an account on GitHub.
not guilty
not guilty9mo ago
don't commit your bin folder there's a bunch of stuff that is unclear to me why are you not sending a body, it would be the post content also what is the content type of this post? html?
khauvannam
khauvannam9mo ago
I think i sending the body So what should i do next? Sorry i am still a newbie, so what should i do next? Just ignore bin/** and obj folder
not guilty
not guilty9mo ago
ok but you understand it shouldn't be there in the first place it makes downloading the project from 30 KB to like 8 MB it's like 300x the size i would ask you describe what the CreatePost api should do send the post? send post + attachments? and in which format: multipart, json... are there requirements or are you building it from scratch
khauvannam
khauvannam9mo ago
Send the post + attachment, the attachment will be store in my azure blob Then respone the content, id, and the url of my blob file Multipart form, it will return an json which i can use for my frontend I build it from scratch
not guilty
not guilty9mo ago
[hopefully i can sand messages now] using multipart would be more involved if you search how to read multipart from c# you'll find articles even from microsoft https://learn.microsoft.com/en-us/aspnet/web-api/overview/advanced/sending-html-form-data-part-2
Sending HTML Form Data in ASP.NET Web API: File Upload and Multipar...
This tutorial shows how to upload files to a web API. It also describes how to process multipart MIME data.
Accord
Accord9mo 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
❔ ✅ cannot get xaml designer to show in visual studioHas anyone else had an issue with getting any of the xml files to show in the designer preview in vi❔ Function with generic argument as a setterHeyo, I'm currently trying to do something like this:✅ ✅ Static constructor for C# class not being calledI declared a class, here `X` which has a normal constructor and a static constructor. The static co❔ NewtownSoft.JSON and classes that need references to its ownerI have two classes. Class A owns instances of Class B. But each instance of Class B needs a refere❔ Is it correct to use a single instance of Azure Front Door for different types of resources?I have an AFD profile in a resource group which was intended to be used to server Web APIs and it ha✅ DB context injection not workinghi, i have app like this - ```cs DotNetEnv.Env.Load("../build/"); var builder = WebApplication.Crea❔ Trying to find a way so it shows the sum of all the numbers entered and the also the average.```cs Modifier votre code Q2 afin de calculer/afficher la somme et ❔ What would be the best way to dynamicly cut in a string>So for example I have this: "C:\Users\USERNAME\Documents\Paradox Interactive\Hearts of Iron IV\mod\H❔ Reloading MainWindow after some changesHello guys, im currently working on a project to improve my C#/programming skills. I have following❔ need some help with a microsoft visual studio 2022 project im doinghttps://dotnetfiddle.net/ got my fiddle here, just nothing aint working and im lost rn