General HTTP Request debugging

I’m having difficulties creating even simple HTTP requests.

I’m trying to query the IGDB API. I’ve long since given up on actually using the Credentials feature, since I couldn’t make it work; I decided to just try entering raw headers with auth info, + raw body, since the IGDB API uses plaintext querying language (and returns JSON).

I.e., the body of the POST request should look like this:

search "whatever game";
fields name, summary, genres, url, rating, aggregated_rating, themes, involved_companies.company.name,involved_companies.developer,involved_companies.publisher;

I’ve tried every permutation of settings I could come up with; I didn’t get anything better than a “Entries exist but they do not contain any JSON data.” in the Table tab, and this in the JSON:

image

How do I troubleshoot this? I can’t use a local proxy, since the browser only sends an ‘execute’ command and the request is executed (I presume) on the server; I haven’t found anything useful in the settings, dev tools console, or anywhere else.

So what can I do to troubleshoot this? (And the request itself really isn’t that complex: it requires maybe 3 headers and a string body, that’s all.)

Welcome to the community @zblesk!

Sorry to hear that you have problems. If you want to “debug” the HTTP Request you are sending, it is probably best to send the request to a page like https://webhook.site/
There you can see exactly what data n8n sends.

But it sounds like it would look something like this:

{
  "nodes": [
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://example.com",
        "responseFormat": "string",
        "jsonParameters": true,
        "options": {
          "bodyContentType": "raw"
        },
        "bodyParametersJson": "search \"whatever game\";\nfields name, summary, genres, url, rating, aggregated_rating, themes, involved_companies.company.name,involved_companies.developer,involved_companies.publisher;",
        "headerParametersJson": "={{ {\"Client-ID\": \"xxx\", \"Authorization\": \"Bearer xxxx\"} }}"
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        439,
        350
      ]
    }
  ],
  "connections": {}
}
1 Like

Thanks.

I tried the webhook.site, but the request doesn’t show up at all, even though I get a “Workflow did get executed successfully!” message.

I’ve tried calling the webhook.site from postman and that showed up immediately, so that’s not the issue…
any other ideas?

Also - sorry if that’s a dumb question, I’m new to n8n - can I add a node into an existing workflow by pasting in a JSON, like the one you posted?

If your requests do not make it to webhook.site and so do not get displayed there is def. something very strange going on. Have not the slightest idea why that could happen right now. Never heard of something like that before.

Yes, you can simply select the JSON, copy it, click once in n8n and then paste (ctrl + v). The node should then appear.

1 Like

I managed to get something working when I started from the beginning and created a new request.

These are the settings I have now:

The error I get is

There was a problem executing the workflow:
"Cannot create property 'Content-Type' on string 'Client-ID=ABC Authorization=Bearer EDF'"

The headers are like this:

Client-ID=ABC
Authorization=Bearer DEF

Tried the heades in JSON form as well, which worked only until I switched the Body Content Type to Raw. (And if I didn’t do that, then the body was encoded and therefore invalid.)

Please check my above example and how I set the header.

1 Like

Sorry, you wrote that post while I was composing mine and I’d missed it.
The headers work now, thanks!

(The request still doesn’t - even though it looks basically the same compared to the one from Postman, it returns no data to n8n. I’ll fiddle with it a bit more, maybe that’ll help.)

No more questions for now - thank you for your time and your help!