I'm trying a put operation against a WCF webapi service using jQuery 1.7.1. The relevant client code is:
$.ajax(
{
type: 'PUT',
contentType: 'application/json',
dataType: 'json',
url: '../webapi/esfuerzos/' + id,
data: { json: args },
success: function (respuesta) {
$("cancelarEsfuerzoTerreno").trigger("tap");
},
error: function (respuesta) {
debugger;
}
});
The following method signature is on the server:
[WebInvoke(UriTemplate = "{idTicket}", Method = "PUT", RequestFormat = WebMessageFormat.Json)]
public HttpResponseMessage Agregar(int idTicket, JsonValue json)
When I call the client code I get a 500 - internal server error response. What might be causing this?
edit: here's the raw http mesage
PUT http://localhost/mosaq/sae/webapi/esfuerzos/12 HTTP/1.1
Accept: application/json, text/javascript, */*; q=0.01
Content-Type: application/json
X-Requested-With: XMLHttpRequest
Referer: http://localhost/mosaq/sae/movil/
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: localhost
Content-Length: 355
Connection: Keep-Alive
Pragma: no-cache
Cookie: ASP.NET_SessionId=jy0shfatrj4icobvagysrnm2
json%5BpreparacionCoordinacionMinutos%5D=null&json%5BpreparacionCoordinacionHoras%5D=null&json%5BesperaMinutos%5D=null&json%5BesperaHoras%5D=null&json%5BtrasladoIdaFin%5D=null&json%5BtrasladoIdaInicio%5D=null&json%5BtrasladoRegresoFin%5D=null&json%5BtrasladoRegresoInicio%5D=null&json%5BejecucionFin%5D=null&json%5BejecucionInicio%5D=null&json%5Btipo%5D=0