Can't figure out why HTTP Request to Odoo doesn't work

Post Reply
dfreese
Newbie
Posts: 11
Joined: Thu May 23, 2019 4:16 pm

Can't figure out why HTTP Request to Odoo doesn't work

Post by dfreese »

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!
mkayyyy
Member
Posts: 100
Joined: Mon Nov 21, 2016 6:31 pm
Location: UK

Re: Can't figure out why HTTP Request to Odoo doesn't work

Post by mkayyyy »

Have you got an example of the HTTP Request configuration you have in Switch and the Postman request you're making?
dfreese
Newbie
Posts: 11
Joined: Thu May 23, 2019 4:16 pm

Re: Can't figure out why HTTP Request to Odoo doesn't work

Post by dfreese »

Sure, here's the body I'm adding:

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
}
Here's the properties in Switch:
http_properties.PNG
http_properties.PNG (16.06 KiB) Viewed 184 times
And the header is just Content-Type:application/json
freddyp
Advanced member
Posts: 1158
Joined: Thu Feb 09, 2012 3:53 pm

Re: Can't figure out why HTTP Request to Odoo doesn't work

Post by freddyp »

Try this: create a JSON file with the content that you want to post and in the "Body content" dropdown you choose "Input job".
dfreese
Newbie
Posts: 11
Joined: Thu May 23, 2019 4:16 pm

Re: Can't figure out why HTTP Request to Odoo doesn't work

Post by dfreese »

freddyp wrote: Tue Oct 28, 2025 10:28 am Try this: create a JSON file with the content that you want to post and in the "Body content" dropdown you choose "Input job".
Thank you, that worked!
Post Reply