How to pass web service post method request body in fiddler RRS feed

  • Question

  • I have a very simple web service in .net

    [WebInvoke(Method = "POST",
    ResponseFormat = WebMessageFormat.Json,
    BodyStyle = WebMessageBodyStyle.Wrapped,
    UriTemplate = "xml?id={id}")]

    string XMLData(string id);

    When I am checking it in Fiddler by passing following URL,its working fine


    but when I am passing the parameter in request body of fiddler its not working


    Request Header
    Content-Type: application/x-www-form-urlencoded

    Request Body

    If anybody has any Idea about it, please help me with this.

    Sunday, April 22, 2012 5:20 PM


  • It seems that you cannot do that, but you can change your code:

                    [WebInvoke(UriTemplate = "/xml/", Method = "POST",
                BodyStyle = WebMessageBodyStyle.Wrapped,
                ResponseFormat = WebMessageFormat.Json)]
            string XMLData(string id);
            public string XMLData(string id)
                return id;

    The request header in fiddler:

    Host: localhost:15587
    Content-Length: 22
    Content-Type: application/json;charset=UTF-8

    and the request body in fiddler:


    and set the method as "POST" and request URL as follows:


    and then you can test it in Fiddler, you will see the following test result:


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact Microsoft One Code Framework

    Monday, April 23, 2012 10:26 AM