the problem is as follows:
I want to consume a RESTful Service using get with a body. For testing purposes I am using Fiddler Web Debugger.
Now, the following GET request put into Fiddler gets me the result I am expecting:
GET http://localhost:3787/TerminologyService/Autosuggest/ HTTP/1.1
Host: localhost:3787
Content-Length: 215
Content-Type: application/json
{
"Text": "war",
"Count": "100",
"MedicationWeight": "7",
"ActivityWeight": "0",
"DiseaseWeight": "0",
"GeneWeight": "0",
"SymptomWeight": "0",
"AnatomyWeight": "0",
"OrderingType": "CATEGORY_DIVERSITY"
}
So now I'd do the same thing using $http.get. Here is what i have so far:
function getTerms(text, count, medWeight, actWeight, disWeight, genWeight, symWeight, anaWeight, orderingType)
{
var config = {
headers: {'Content-Type' : 'application/json'},
params: {Text : text,
Count : count,
MedicationWeight : medWeight,
ActivityWeight : actWeight,
DiseaseWeight : disWeight,
GeneWeight : genWeight,
SymptomWeight : symWeight,
AnatomyWeight : anaWeight,
OrderingType : orderingType}
}
return $http.get(
'http://localhost:3787/TerminologyService/Autosuggest', config);
}
This does get formed into a GET url:
http://localhost:3787/TerminologyService/Autosuggest?ActivityWeight=0&AnatomyWeight=0&Count=10&DiseaseWeight=0&GeneWeight=0&MedicationWeight=7&OrderingType=CATEGORY_DIVERSITY&SymptomWeight=0&Text=war
Unfortunately, this causes an error 500 at the webservice.
When I check the captured traffic in Fiddler thats been generated by the $http.get call I find that the JSON data is not being passed as the body (obviously, since it is passed in the URL). So I'm not able to get what I first tested in Fiddler
Any help is much appreciated