I am trying to create a PUT request using Fiddler but I am constantly receiving an error as follows.
PUT Request
https://127.0.0.1/odata/ControllerName('param')
Request Header
Accept: application/json;odata=minimalmetadata
Host: 127.0.0.1
Authorization: ApiKey uniqueKey
Content-Type: application/json;odata=minimalmetadata
Accept-Charset: UTF-8
RequestBody
{"Name":"param"}
When I am trying to PUT, it returns me status code 400. When I double click error in fiddler and view JSON tab, it gives me following error.
odata.error
innererror
message=actionParameters : The last segment of the request URI 'ControllerName('param')' was not recognized as an OData action.
Where I am going wrong, with URI format or request body?
According to OData protocol, the value within the parenthesis following the entity set(corresponds to a controller) must be a key, for example:
So please make sure the key is of string type in your case, and try to
GET https://127.0.0.1/odata/ControllerName('param')
to see whether the response is as expected.