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

I have made a controller . Now I want to send a json object as post body from Postman. Can anyone give me a code example?

아바타
취소
베스트 답변

Hope this will helps you:

# -*- coding: utf-8 -*-
from openerp import http
from openerp.http import Controller, route, request
import json
import ast
import yaml
import time
from datetime import datetime



class ObeAttendanceApi(http.Controller):
@http.route('/api/attendance/', auth='public', methods=['POST'], type='http')
def index(self, **kw):
data = request.httprequest.data
data_in_json = yaml.load(data)
# use "data_in_json" according to your requirement


Reference: http://learnopenerp.blogspot.com

아바타
취소
베스트 답변

Hi, i am trying the same but it's through me error that page not found. Can you please guide me what step i am missing. 

thank you 


아바타
취소