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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
2
Trả lời
16033
Lượt xem
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
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
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký