Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use ?for example use curl to post the json message #2

Open
lizhi2013 opened this issue Aug 29, 2016 · 3 comments
Open

how to use ?for example use curl to post the json message #2

lizhi2013 opened this issue Aug 29, 2016 · 3 comments

Comments

@lizhi2013
Copy link

how to use ?for example use curl to post the json message
have any demo?

@acidjunk
Copy link

Same here; i started the webserver and navigate to:
http://localhost:3000/odoo-client

500 SyntaxError: Unexpected token u in JSON at position 0

@drm-code
Copy link

Any solutions? I have same error

@rkrw
Copy link

rkrw commented Feb 24, 2021

for anyone who still want to try this, i managed to make it work, the method is GET and json you just need to make the payload into correct json format without "client_req ="

then install body parser from NPM, it's seem the parser from node express doesn't work in this
goes to app.js, make constanta of bodyParser from NPM, change the bodyparser from express, just comment it

use it like this "app.use(bodyParser.json());"

then goes to routes/index.js
on the export.index
change some codes from req.query.client_req to just 'req.body'
then remove the json.parse
change var data to just use 'req.body'

it's work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants