# HTTP request : url set by Inject-node or Function-node

**URL:** <https://discourse.nodered.org/t/http-request-url-set-by-inject-node-or-function-node/94347>\
**Category:** General\
**Created:** [4 January 2025 08:47 UTC](https://discourse.nodered.org/t/http-request-url-set-by-inject-node-or-function-node/94347 "2025-01-04T08:47:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tany](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@Tany](https://discourse.nodered.org/u/Tany)\
**Post date:** [4 January 2025 08:47 UTC](https://discourse.nodered.org/t/http-request-url-set-by-inject-node-or-function-node/94347/1 "2025-01-04T08:47:00Z")

</div>

URL is responding when entered via Inject, or via Chrome browser.  
Responding with "Forbidden" when entered via Function Node.  
What is the difference ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/6/963bf411e569a3154183e47c372dd7fcf24c87f3.png)

Cheers,  
T

```auto
[
    {
        "id": "4b706968f2762ff3",
        "type": "function",
        "z": "c3eacf524719b6d5",
        "name": "set URL",
        "func": "var url = \"https://opendata.elia.be/api/explore/v2.1/catalog/datasets/ods087/records?select=*&where=region%20%3D%20%22Flanders%22%20and%20dayaheadconfidence10%20%2B%20dayaheadconfidence90%20%3E%200&order_by=datetime&limit=96&timezone=Europe%2FBrussels&refine=region%3A%22Flanders%22\";\nmsg.url = url;\nnode.warn(url);\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 280,
        "y": 4040,
        "wires": [
            [
                "4f2105828abfe760",
                "fa586f505cb20735"
            ]
        ]
    },
    {
        "id": "d1876e34b33f62e0",
        "type": "http request",
        "z": "c3eacf524719b6d5",
        "name": "ELIA API V2.1",
        "method": "GET",
        "ret": "obj",
        "paytoqs": "body",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 460,
        "y": 3940,
        "wires": [
            [
                "83123d33249176e5"
            ]
        ]
    },
    {
        "id": "1c2288a47b4b5d7e",
        "type": "inject",
        "z": "c3eacf524719b6d5",
        "name": "inject url",
        "props": [
            {
                "p": "url",
                "v": "https://opendata.elia.be/api/explore/v2.1/catalog/datasets/ods087/records?select=*&where=region%20%3D%20%22Flanders%22%20and%20dayaheadconfidence10%20%2B%20dayaheadconfidence90%20%3E%200&order_by=datetime&limit=96&timezone=Europe%2FBrussels&refine=region%3A%22Flanders%22",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 120,
        "y": 3940,
        "wires": [
            [
                "d1876e34b33f62e0",
                "d95342606cf8f9ac"
            ]
        ]
    },
    {
        "id": "83123d33249176e5",
        "type": "debug",
        "z": "c3eacf524719b6d5",
        "name": "debug 237",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 630,
        "y": 3940,
        "wires": []
    },
    {
        "id": "7638a54ef79ac673",
        "type": "comment",
        "z": "c3eacf524719b6d5",
        "name": "https://opendata.elia.be/api/explore/v2.1/catalog/datasets/ods087/records?select=*&where=region%20%3D%20%22Flanders%22%20and%20dayaheadconfidence10%20%2B%20dayaheadconfidence90%20%3E%200&order_by=datetime&limit=96&timezone=Europe%2FBrussels&refine=region%3A%22Flanders%22",
        "info": "",
        "x": 1030,
        "y": 3900,
        "wires": []
    },
    {
        "id": "4f2105828abfe760",
        "type": "http request",
        "z": "c3eacf524719b6d5",
        "name": "ELIA API V2.1",
        "method": "GET",
        "ret": "obj",
        "paytoqs": "body",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 460,
        "y": 4040,
        "wires": [
            [
                "277347341e19c218"
            ]
        ]
    },
    {
        "id": "98d892b9c1441650",
        "type": "inject",
        "z": "c3eacf524719b6d5",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 120,
        "y": 4040,
        "wires": [
            [
                "4b706968f2762ff3"
            ]
        ]
    },
    {
        "id": "277347341e19c218",
        "type": "debug",
        "z": "c3eacf524719b6d5",
        "name": "debug 238",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 630,
        "y": 4040,
        "wires": []
    },
    {
        "id": "d95342606cf8f9ac",
        "type": "debug",
        "z": "c3eacf524719b6d5",
        "name": "debug 239",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 310,
        "y": 3980,
        "wires": []
    },
    {
        "id": "fa586f505cb20735",
        "type": "debug",
        "z": "c3eacf524719b6d5",
        "name": "debug 240",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 470,
        "y": 4100,
        "wires": []
    }
]

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [4 January 2025 09:10 UTC](https://discourse.nodered.org/t/http-request-url-set-by-inject-node-or-function-node/94347/2 "2025-01-04T09:10:33Z")

</div>

The inject sends no msg.psyload, the function does as there is one set in the inject. As you have selected `set payload as body of request ` in the http node, the payload is attached as the body, try not sending a payload or selecting ignore.

---

<div class="post-metadata">

**Author:** ![Tany](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@Tany](https://discourse.nodered.org/u/Tany)\
**Post date:** [4 January 2025 09:31 UTC](https://discourse.nodered.org/t/http-request-url-set-by-inject-node-or-function-node/94347/3 "2025-01-04T09:31:16Z")

</div>

ok.  
I changed in the HTTP Request-node : "Payload: Ignore", and it works.  
Thanks.  
T

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 January 2025 09:31 UTC](https://discourse.nodered.org/t/http-request-url-set-by-inject-node-or-function-node/94347/4 "2025-01-18T09:31:59Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
