Currently Trying to call a odoo controller which return json data as per my exception .
@http.route('/web/update_order_webhook', type='http', csrf=False, auth="public")
def update_order_webhook(self, **kwargs):
return Response(json.dumps({"yes":"i am json"}),content_type='application/json;charset=utf-8',status=200)
when i tried to call this end point
import requests
url = "http://159.89.197.219:8069/web/update_order_webhook"
headers = {
'content-type': "application/json"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
I get Request Body
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>Invalid JSON data: ''</p>
And Request Header at my calling end point
content-length →137
content-type →text/html
date →Thu, 11 Jan 2018 20:32:53 GMT
server →Werkzeug/0.13 Python/3.5.2
that clearly mean that i am not getting json response data from my odoo endpoint . Please correct me if i am wrong at any point. Thanks for your time