Skip to Content
Menu
This question has been flagged

I do have some issues when using a custom written module with http.route.

In the controller i added a route :


@http.route('/test/update', type='http', auth='public', website=False )
def test(self, request, **kwargs):
returnValue = {"data": {"id": "something"}}
return http.request.render('custom_module.detail_page', returnValue)
 


The view just writes the returnValue of the routeMethod


<template id="detail_page" name="Detail page" page="True">
<t t-raw="data"/>
</template>


So when i call the route with http://localhost:8069/test/update via my browser, i do get a correct response :

{'id': 'something'}

But what i really want to do is to send some post requests to http://localhost:8069/test/update to work with the post-Data sent and execute some internal methods.

A call to the same route with this ruby code:

url = "http://localhost:8069/test/update"
headers = {}
data= {"id": 2 }
response = HTTParty.get(url,
                      body: { json: JSON.generate(data, {}) },
                      headers: headers,
                      debug_output: $stdout)

leads to a 404 Error with this info :

INFO ? werkzeug: 127.0.0.1 - - [26/Sep/2018 11:21:02] "GET /test/update HTTP/1.1" 404 -

When i put this in my environment on a server, the ruby method works properly and returns

{'id': 'something'}


Is there something i need to know, when using localhost or 127.0.0.1 with odoo and routing?


Any help is appriciated!


Thx,


Patrick


Avatar
Discard

Please clarify your question .....

i didn't get any idea about your question.

because their is no error ... your route is completely worked as you said..

Related Posts Replies Views Activity
2
Nov 24
25067
2
May 24
5513
3
Mar 24
4962
0
Mar 24
261
3
Feb 24
11415