Alright trying to get http protocol
# umh-support
b
Alright trying to get http protocol converter to work, but no luck. Same payload works in nodered and curl, just not benthos:
Copy code
http_client:
  url: "http://<REDACTED>/jsonrpc"
  verb: POST
  headers: |
    {
      "Content-Type": "application/json",
      "Authorization": "Bearer <REDACTED>"
    }
  payload: |
    {
      "jsonrpc": "2.0",
      "method": "call",
      "params": {
        "service": "object",
        "method": "execute_kw",
        "args": [
          "<REDACTED>",
          <REDACTED>,
          "<REDACTED>",
          "project.task",
          "search_read",
          [],
          { "fields": ["id", "name", "stage_id", "date_deadline"] }
        ]
      },
      "id": <REDACTED>
    }
j
guess that was an accident?
b
yup lol
So it has an issue with the json payload: | {}
The json payload works with everything else, but benthos.
Seems like it's failing cuz it has to be a string, not an object... https://docs.redpanda.com/redpanda-connect/components/inputs/http_client/#payload
j
i am already currently on my home computer, so I cant reproduce. But did you managed to fix it with it being a string?
b
Lol no cuz "" make it exist, so I have to use backslash" but even then once it sees the first { it treats it like yaml
j
in yaml you can do with | a multi line string
payload: | whateber newline still payload notPayloadAnymore: "hello123"
ask o1-mini 🙂
b
Problem still lies with the first {. Once it sees it, yaml flips out.
j
Can you share a screenshot? Make sure you indent the line after the |
b
DM'ed
2 Views