콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
6203 화면

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
5082
1
7월 25
8987
4
3월 25
43905
1
9월 20
6970
6
7월 20
12595