Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
4229 Prikazi

i'm encountering an error like this  while fetching data

  WARNING mydb odoo.http: returns an invalid response type for an http request


Here is my python code

@http.route('/vehicle_web_form', methods=['GET'],  website=True, auth='public', csrf=False)
def vehicle_web_form(self, **kw):
print(kw)
id = kw.get("id")
print(id)
print(type(id))
return id


Avatar
Opusti
Best Answer

If you want to return the information you have to use the type JSON instead of HTTP, and return JSON.

For Eg:-

@http.route('/vehicle_web_form', type='json', auth="public", csrf=False)
def vehicle_web_form(self, **kw):
print(kw)
id = kw.get("id")
print(id)
print(type(id))
result_response = json.dumps({'data':id})
return json.loads(result_response)


Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
avg. 24
2218
2
apr. 24
1525
1
dec. 23
2540
1
apr. 24
2060
2
avg. 23
2239