Rest requests not including headers

  • Goal:
    I'd like to send a custom header in POST request.

  • Steps:
    I've added the headers to the REST request. I inspected the state of the rest request and it shows the two custom headers, but in they don't show up in logs. I tried a curl request to see if it was something with the server, but with curl everything works correctly.

  • Details:
    [maeztro-produccion] [2024-10-11 15:26:22] Host: xxxxxxxx.ondigitalocean.app
    [maeztro-produccion] [2024-10-11 15:26:22] Cdn-Loop: cloudflare; loops=1
    [maeztro-produccion] [2024-10-11 15:26:22] Accept-Encoding: gzip, br
    [maeztro-produccion] [2024-10-11 15:26:22] X-Forwarded-For: xxxxxxxxxxxxxx
    [maeztro-produccion] [2024-10-11 15:26:22] Content-Length: 178
    [maeztro-produccion] [2024-10-11 15:26:22] X-Forwarded-Proto: https
    [maeztro-produccion] [2024-10-11 15:26:22] Content-Type: application/json
    [maeztro-produccion] [2024-10-11 15:26:22] User-Agent: Retool/2.0 (+https://docs.tryretool.com/docs/apis)
    [maeztro-produccion] [2024-10-11 15:26:22] Ot-Baggage-Requestid: undefined
    [maeztro-produccion] [2024-10-11 15:26:22] X-Datadog-Trace-Id: 4600402542691402978
    [maeztro-produccion] [2024-10-11 15:26:22] X-Datadog-Parent-Id: 5495594424649792150
    [maeztro-produccion] [2024-10-11 15:26:22] X-Datadog-Sampling-Priority: 0
    [maeztro-produccion] [2024-10-11 15:26:22] X-Datadog-Tags: _dd.p.dm=-1
    [maeztro-produccion] [2024-10-11 15:26:22] Traceparent: 00-00000000000000003fd7e9bd14ecc4e2-4c44460326de3a96-00
    [maeztro-produccion] [2024-10-11 15:26:22] Tracestate: dd=t.dm:-1;s:0
    [maeztro-produccion] [2024-10-11 15:26:22] X-Retool-Forwarded-For: 179.50.81.106
    [maeztro-produccion] [2024-10-11 15:26:22] Accept: /
    [maeztro-produccion] [2024-10-11 15:26:22] Do-Connecting-Ip: 35.90.103.132
    [maeztro-produccion] [2024-10-11 15:26:22] API_KEY in request: None

  • Screenshots:

  • App json export:

Hi @Santiago_Gonzalez Thanks for reaching out!

Just to confirm, when you look at the query in the state tab, it shows that an api key was passed to the resource like this?

Which logs are you referring to when you say the header doesn't show up (Retool audit logs, logs for the api, etc)?

Is the API_KEY value hardcoded or is it dynamic (inside double curly brackets {{}})?
Have you tried moving the custom headers to the resource set up? Typing it in the query config should work, but we usually recommend configuring api keys in the resource set up if possible.

Does the resource set up already have auth steps or other headers defined?

1 Like

Yes that's right

Logs for the API. If I send a request through CURL, I see the headers. If I do it through Retool, I don't see any of the custom headers.

The API_KEY is hardcoded. Yes, I've tried adding it to the resources. I've also set other headers in the resources (to check that API_KEY wasn't being filtered for whatever reason) and those don't get included either. No other auth steps.

I haven't been able to track down any known bugs related to this :thinking: It's very strange behavior

Is there any api documentation for this endpoint? Are there any other endpoints for this api where you can successfully add headers to your Retool request? Just hoping to narrow the scope of the issue a bit!

If you run the same query in Postman, does it also work there? If so, can you share screenshots (also ok to dm the screenshots)