How would you send a request (from python) that ultimately ends up looking like this in the live header on the web page (http://localhost:8080):
POST /rest/marker/
json=%7B%22label%22%3A%22w%22%2C%22folderId%22%3Anull%2C%22url%22%3A%22%23FF0000%22%2C%22comments%22%3A%22%22%2C%22position%22%3A%7B%22lat%22%3A39.426912683948%2C%22lng%22%3A-120.20892536635%7D%7D&tid=0V7V
In better syntax, the POST request looks like this:
URL=http://localhost:8080/rest/marker/
json: {"label":"my label here","folderId":null, "url":"#FF0000","comments":"","position":{"lat":39.2965796259061,"lng":-120.16708374023438}}
tid: "0V7V"
(please ignore the data values, they are different in each of these tests)
I've tried several variations like the following:
a=requests.post("http://localhost:8080/rest/marker",data="json=%7B%22label%22%3A%22stuff%22%2C%22folderId%22%3Anull%2C%22url%22%3A%22%2300FF00%22%2C%22comments%22%3A%22%22%2C%22position%22%3A%7B%22lat%22%3A39.418%2C%22lng%22%3A-120.2%7D%7D&tid=0V7V")
a=requests.post("http://localhost:8080/rest/marker",json={"label":"stuff","folderId":"null","url":"#FF0000","comments":"","position":{"lat":39.4112,"lng":-120.2},"tid":"0V7V"})
a=requests.post("http://localhost:8080/rest/marker/",json={"label":"stuff","folderId":"null","url":"#FF0000","comments":"","position":{"lat":39.4112,"lng":-120.2}},data={"tid":"0V7V"})
The stacktrace I get in the response text always starts with this, which probably just indicates I'm doing it wrong:
java.lang.ClassCastException: net.sf.json.JSONNull cannot be cast to
net.sf.json.JSONObject
What's the right way to do this?
Status Code: 500
Exception:Stacktrace: – Tom Grundy Sep 24 '15 at 16:05