Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4147 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
aug. 24
2145
2
apr. 24
1473
1
dec. 23
2367
1
apr. 24
1969
2
aug. 23
2151