Answer the question
In order to leave comments, you need to log in
How to process and send json in pure python or bottle?
Java Scipt sending a request:
var xhr = new XMLHttpRequest();
xhr.open('GET', ' 127.0.0.1:8080 ');
xhr.send(JSON.stringify({a:1, b:2));
alert( xhr.responseText )
Please tell me how to get json in python, process it and return server status(200) and json object back to javascript.
My python code:
import http.server
http.server.test()
outputs to console:
127.0.0.1 - - [28/Feb/2018 00:28:55] "GET / HTTP/1.1" 200
without json and returns nothing
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question