I'm trying to make a POST this endpoint link (it's a simple API I've done with Django Rest)
I'm using Windows Forms C #
Follow the call:
using (var client = new HttpClient())
{
client.BaseAddress = new Uri(UtilDAO.UrlApi());
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await client.PostAsJsonAsync("/emitente", emitente);
return response;
}
And it's returning me 500
{StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Connection: keep-alive
Transfer-Encoding: chunked
X-Frame-Options: SAMEORIGIN
Date: Tue, 02 Aug 2016 23:05:36 GMT
Server: gunicorn/19.6.0
Via: 1.1 vegur
Content-Type: text/html
}}
Would anyone know what it could be?
GET Works!
If you wanted to see the API, check it out: link