We've been using been using the HTTP Request app for a few years sending requests to our local FileMaker server with no issues. I'm able to get a Post request to Odoo to work on Postman, but I'm not sure which headers are filled in automatically and which ones I need to fill out. I'm also not sure if there's a setting in the Preferences I'm not setting up that I'm supposed to. When I try to send a 'POST a body' request and I have the same body sending to the same url as Postman.
It works on Postman, but I get a 400 error code back in Switch.
Anything insight would be appreciated!
Can't figure out why HTTP Request to Odoo doesn't work
Re: Can't figure out why HTTP Request to Odoo doesn't work
Have you got an example of the HTTP Request configuration you have in Switch and the Postman request you're making?
Re: Can't figure out why HTTP Request to Odoo doesn't work
Sure, here's the body I'm adding:
Here's the properties in Switch:
And the header is just Content-Type:application/json
Code: Select all
{
"jsonrpc": "2.0",
"method": "call",
"params": {
"service": "object",
"method": "execute_kw",
"args": [
"odoodatabasehere",
10,
"apitokenhere",
"sale.order.line",
"write",
[[43], {"x_studio_pitstop_status": "Test11"}]
]
},
"id": 1
}
Re: Can't figure out why HTTP Request to Odoo doesn't work
Try this: create a JSON file with the content that you want to post and in the "Body content" dropdown you choose "Input job".