コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
5727 ビュー

Hello, I want to do a simple json request. But it fails all time with this:

Bad Request

<function className at 0x7fcb5df30aa0>, /test/some_json: Function declared as capable of handling request of type 'json' but called with a request of type 'http'


My code looks like this:


from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
import openerp
import json


class MyController(http.Controller):

@http.route('/test/some_json', type="json", auth="public", website=True)
def some_jsons(self):
return [{"sample_dictionary": "This is a sample JSON dictionary"}]


what is wrong here? I have no javascript in my module. 

thanks




アバター
破棄
最善の回答

I think you are calling an HTTP request, but you are handling with type JSON. would be good if you update your question with the call.

アバター
破棄
著作者

I don't have another call. have you an example for me ?

関連投稿 返信 ビュー 活動
0
3月 17
4451
1
7月 25
8309
4
3月 25
42099
1
9月 20
6417
6
7月 20
11601