Community mailing list archives

community@mail.odoo.com

ODOO JSON POST ERROR

by
Bheco Services, Mouad Hamri
- 02/01/2016 14:49:50

Hello odoo commnuity,

 

We’re trying to handle in odoo some json sent from an external system but we always get 404 error.

 

The controller code is:

 

# -*- coding: utf-8 -*-
from openerp import http

class Portal(http.Controller):

    @
http.route('/portal_abc',type='json',auth='none')
   
def callback(self,**post):
       
print post
       
return True

And the python code we did to test the json post is:

 

import requests

r = requests.post("http://localhost:8069/portal_abc ", data = {"key":"value"})

print r

 

Have you ever faced such issue? If yes what was the solution?

 

Thank you in advance.

 

 

Best regard,

Mouad HAMRI
Associate Director
BHECO Services
Casablanca, MOROCCO

Tél: +212 (0) 5 22 87 54 06
Fax: +212 (0) 5 22 87 54 04

GSM: +212 (0) 6 61 98 69 91

E-mail.mouad.hamri@bhecoservices.com
Web Site
:www.bhecoservices.com

 

<img border=0 width=159 height=64 id="Image_x0020_1" src="cid:image001.png@01D15D29.B6010EE0" alt="cid:image001.png@01D0C924.C3441910">