Submitting a Report HTTP POST - InternalServerError


#1

With a Winrt Application (windows 8 store app)   I’m trying to submit a new report by using HTTP POST but return a internal error:

System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error)

 

 

This is my code:

 

string uri = “http://www.geoalert.it/?task=report”;

// this is what we are sending

string post_data = “&incident_title=” + newincident_title + “&incident_description=” + newincident_description +

“&incident_date=” + newincident_date + “&incident_hour=” + newincident_hour + “&incident_minute=” + newincident_minute +

“&incident_ampm=” + newincident_ampm + “&incident_category=” + newincident_category + “&latitude=” + newlatitude + “&longitude=” +

newlongitude + “&location_name=” + newlocationname ;

 

HttpContent streamContent = new StringContent(post_data);

httpClient.DefaultRequestHeaders.ExpectContinue = false;

HttpResponseMessage response = await httpClient.PostAsync(uri,streamContent);

response.EnsureSuccessStatusCode();