stack twitter tryhackme rss linkedin cross

Wilco van Esch

Skip to main content

Search results

    400 Bad Request for a POST request to a WCF service

    Problem

    {"ErrorDetail":"Incoming messages must have a body format
    of Raw or Xml. Is a ContentTypeMapper set on the
    WebHttpBinding?","Status":"INVALID_ARGUMENTS"}
    

    Background

    A POST request to a WCF service through Postman (though a request through curl gives the same result).

    https://client-webservice.provider.com/WebService/api/rest/
    category/getInterestingDetails?ParamID=123456)
    

    Username and password are provided through Basic Auth, which adds another param in addition to the ParamID example parameter.

    The service can return JSON. Content-Type is set to application/json.

    Solution

    Solution in my case (in Postman) was to empty the params beyond the authentication details and place those parameters in the raw request body instead.