Skip to Content
Menu
This question has been flagged
1 Atsakyti
4233 Rodiniai

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


Portretas
Atmesti
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)


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
rugp. 24
2220
2
bal. 24
1525
1
gruod. 23
2542
1
bal. 24
2063
2
rugp. 23
2243