Click here to Skip to main content
15,888,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My bottle web service is not able to accept data to process, and am not able to figure out what the problem is.
am suspecting that the route statement and the corresponding def statement is not correct.

It returns:The remote server returned an error: (500) Internal Server Error.)
I need some help to figure this out what the route and def statement should be.
if the c# code is correct.

Here is the client code making the call.

C#
using (var client = new WebClient())
    {
    	var obj = new Dictionary<string, string>()
    	{
    		{"MemberOid", "564d783b54355e2070173117"},
    		{"ConnectionName", "mongodb://100.19.6.122"},
    		{"DBName", "NATHANDB"}
    	};
    	var dataString = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
    	client.Headers[HttpRequestHeader.ContentType] = "application/json";
    	var response = client.UploadString("http://localhost:8080/" + "getData", "POST", dataString);
    } 


Here is the section of the web service, with the route/def statement.

Python
@route('/getData', method='POST')
def getScore(updatedata):
    data = request.body.readline()
    ...
    ...


any help will be appreciated.
thanks.
Posted

1 solution

 
Share this answer
 
Comments
OriginalGriff 17-Dec-15 4:08am    
Please don't repost if your answer doesn't appear immediately - both copies were sent to moderation and had to be reviewed by a "real human" (or me, in this case: a close substitute) before appearing publicly.
I have deleted the "spare".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900