WebService REST request POST error

0

When ordering from POST, I get this error message:

 O servidor remoto devolveu um erro: (400) Pedido incorrecto.

IService is defined as follows:

[WebInvoke(Method = "POST", UriTemplate = "insert/?id={id}&v={v}&dt={dt}&qt={qt}",
            RequestFormat = WebMessageFormat.Xml,
            ResponseFormat = WebMessageFormat.Xml)]
        [OperationContract]
        bool Insert(int id,int v, string dt, int qt);

and the Request I do as follows:

string uploadUrl = @"http://url/ServicePedido.svc/insert/?id=" + id + "&v=" + vim + "&dt=" + daregisto + "&qt=" + quantidade;
                WebRequest addRequest = WebRequest.Create(uploadUrl);
                addRequest.Method = "POST";
                addRequest.ContentLength = 0;
                WebResponse addResponse = addRequest.GetResponse();
    
asked by anonymous 28.03.2014 / 18:22

1 answer

1

I have researched, and there is a group recommending this app to debug request

link

This type of error is undefined, but most cases are:

1) Rest structure sent does not match any template that was built 2) if the rest server has an area that requires logging in.

Source: link

    
29.03.2014 / 04:24