If I define a GET operation as follows:
[OperationContract]
[WebInvoke(UriTemplate = "/findcategories", Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
FindCategoriesResponse FindCategories(FindCategoriesRequest request);
but when I try this I get the exception:
Operation 'FindCategories' in contract 'IComplaintService' uses GET, but also has body parameter 'request'. GET operations cannot have a body. Either make the parameter 'request' a UriTemplate parameter, or switch from WebGetAttribute to WebInvokeAttribute.
Is there no way of accepting a JSON object as a parameter when doing GET request?
Thanks
Nope. With a GET request you use query string parameters. If you want to send an entire JSON object you should use POST.