# URL variables http get request

**URL:** <https://discourse.nodered.org/t/url-variables-http-get-request/6484>\
**Category:** General\
**Created:** [7 January 2019 06:10 UTC](https://discourse.nodered.org/t/url-variables-http-get-request/6484 "2019-01-07T06:10:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![riaan](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@riaan](https://discourse.nodered.org/u/riaan)\
**Post date:** [7 January 2019 06:10 UTC](https://discourse.nodered.org/t/url-variables-http-get-request/6484/1 "2019-01-07T06:10:29Z")

</div>

Hi there

I am a Visual Studio Web Developer and have recently started using Node Red and all is new to me.  
I want to pass a variable result using a URL such as [https://xxxxx.fred.sensetecnic.com/api/var/?weight=40](https://xxxxx.fred.sensetecnic.com/api/var/?weight=40) from another device and then get the URL via http get request and display it on a chart. If someone can be of assistance I would really appreciate it. I understand it should be very simple and short.

Kind regards

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [7 January 2019 07:36 UTC](https://discourse.nodered.org/t/url-variables-http-get-request/6484/2 "2019-01-07T07:36:36Z")

</div>

What have you tried, where are you stuck?

If you post the flow you have we can suggest where you night be going wrong.

These pages might also be of help  
[https://cookbook.nodered.org](https://cookbook.nodered.org)

[flows.nodered.org](http://flows.nodered.org) which contains flows you can import into node-red

---

<div class="post-metadata">

**Author:** ![riaan](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@riaan](https://discourse.nodered.org/u/riaan)\
**Post date:** [7 January 2019 10:07 UTC](https://discourse.nodered.org/t/url-variables-http-get-request/6484/3 "2019-01-07T10:07:41Z")

</div>

[

[

{

"id": "e04a7b54.d403d8",

"type": "inject",

"z": "5230c72.fadcf38",

"name": "",

"topic": "",

"payload": "",

"payloadType": "date",

"repeat": "",

"crontab": "",

"once": false,

"onceDelay": 0.1,

"x": 220,

"y": 240,

"wires": [

[

"f5d7c950.a5dfe8"

]

]

},

{

"id": "f5d7c950.a5dfe8",

"type": "http request",

"z": "5230c72.fadcf38",

"name": "",

"method": "GET",

"ret": "obj",

"url": "[https://riaan.fred.sensetecnic.com/api/var](https://riaan.fred.sensetecnic.com/api/var)",

"tls": "",

"x": 400,

"y": 240,

"wires": [

[

"18aad5a3.efd42a",

"9311fd84.3f5d5"

]

]

},

{

"id": "18aad5a3.efd42a",

"type": "debug",

"z": "5230c72.fadcf38",

"name": "",

"active": true,

"tosidebar": true,

"console": false,

"tostatus": false,

"complete": "false",

"x": 620,

"y": 240,

"wires": []

},

{

"id": "9311fd84.3f5d5",

"type": "function",

"z": "5230c72.fadcf38",

"name": "return ",

"func": "return {\n payload: msg.payload.length\n};",

"outputs": 1,

"noerr": 0,

"x": 640,

"y": 340,

"wires": [

[

"6e22171f.b754f8",

"8d4bd9ed.9e3768"

]

]

},

{

"id": "6e22171f.b754f8",

"type": "debug",

"z": "5230c72.fadcf38",

"name": "",

"active": true,

"tosidebar": true,

"console": false,

"tostatus": false,

"complete": "false",

"x": 860,

"y": 360,

"wires": []

},

{

"id": "8d4bd9ed.9e3768",

"type": "ui\_gauge",

"z": "5230c72.fadcf38",

"name": "",

"group": "2472295d.217b26",

"order": 0,

"width": 0,

"height": 0,

"gtype": "gage",

"title": "gauge",

"label": "units",

"format": "{{value}}",

"min": 0,

"max": 10,

"colors": [

"#00b500",

"#e6e600",

"#ca3838"

],

"seg1": "",

"seg2": "",

"x": 860,

"y": 440,

"wires": []

},

{

"id": "2472295d.217b26",

"type": "ui\_group",

"z": "",

"name": "weight",

"tab": "",

"disp": true,

"width": "6",

"collapse": false

}

]

Like I said I'm a first timer, trying to figure out how everything comes together. I want to open the url for example

[https://riaan.fred.sensetecnic.com/api/var/?weight=25](https://riaan.fred.sensetecnic.com/api/var/?weight=25) on another device and then the gauge should display 25.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [7 January 2019 10:14 UTC](https://discourse.nodered.org/t/url-variables-http-get-request/6484/4 "2019-01-07T10:14:22Z")

</div>

Step 1: Please read [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506?u=ukmoose) and then edit your post above

---

<div class="post-metadata">

**Author:** ![riaan](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@riaan](https://discourse.nodered.org/u/riaan)\
**Post date:** [7 January 2019 11:13 UTC](https://discourse.nodered.org/t/url-variables-http-get-request/6484/5 "2019-01-07T11:13:03Z")

</div>

```auto

[

{

"id": "5230c72.fadcf38",

"type": "tab",

"label": "Sheet 1"

},

{

"id": "e04a7b54.d403d8",

"type": "inject",

"z":
"5230c72.fadcf38",

"name": "",

"topic": "",

"payload": "",

"payloadType": "date",

"repeat": "",

"crontab": "",

"once": false,

"onceDelay": 0.1,

"x":
220,

"y":
240,

"wires": [

[

"f5d7c950.a5dfe8"

]

]

},

{

"id": "f5d7c950.a5dfe8",

"type": "http request",

"z":
"5230c72.fadcf38",

"name": "",

"method": "GET",

"ret": "obj",

"url": "[https://riaan.fred.sensetecnic.com/api/var](https://riaan.fred.sensetecnic.com/api/var)",

"tls": "",

"x":
400,

"y":
240,

"wires": [

[

"18aad5a3.efd42a",

"9311fd84.3f5d5"

]

]

},

{

"id":
"18aad5a3.efd42a",

"type": "debug",

"z":
"5230c72.fadcf38",

"name": "",

"active": true,

"tosidebar": true,

"console": false,

"tostatus": false,

"complete": "false",

"x":
620,

"y":
240,

"wires": []

},

{

"id": "9311fd84.3f5d5",

"type": "function",

"z":
"5230c72.fadcf38",

"name": "return ",

"func": "return {\n   
payload: msg.payload.length\n};",

"outputs": 1,

"noerr": 0,

"x":
640,

"y":
340,

"wires": [

[

"6e22171f.b754f8",

"8d4bd9ed.9e3768"

]

]

},

{

"id": "6e22171f.b754f8",

"type": "debug",

"z":
"5230c72.fadcf38",

"name": "",

"active": true,

"tosidebar": true,

"console": false,

"tostatus": false,

"complete": "false",

"x":
860,

"y":
360,

"wires": []

},

{

"id": "8d4bd9ed.9e3768",

"type": "ui_gauge",

"z":
"5230c72.fadcf38",

"name": "",

"group": "2472295d.217b26",

"order": 0,

"width": 0,

"height": 0,

"gtype": "gage",

"title": "gauge",

"label": "units",

"format": "{{value}}",

"min": 0,

"max": 10,

"colors": [

"#00b500",

"#e6e600",

"#ca3838"

],

"seg1": "",

"seg2": "",

"x":
860,

"y":
440,

"wires": []

},

{

"id": "de6c3996.0a78a8",

"type": "http in",

"z":
"5230c72.fadcf38",

"name": "/var",

"url": "/var",

"method": "get",

"upload": false,

"swaggerDoc": "",

"x":
200,

"y":
140,

"wires": [

[

"f5d7c950.a5dfe8",

"7cfd1c48.f8a104"

]

]

},

{

"id": "7cfd1c48.f8a104",

"type": "debug",

"z":
"5230c72.fadcf38",

"name": "",

"active": false,

"tosidebar": true,

"console": false,

"tostatus": false,

"complete": "payload",

"x":
450,

"y":
120,

"wires": []

},

{

"id": "2472295d.217b26",

"type": "ui_group",

"z":
"",

"name": "weight",

"tab": "",

"disp": true,

"width": "6",

"collapse": false

}

]

```

---

<div class="post-metadata">

**Author:** ![riaan](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@riaan](https://discourse.nodered.org/u/riaan)\
**Post date:** [7 January 2019 11:28 UTC](https://discourse.nodered.org/t/url-variables-http-get-request/6484/6 "2019-01-07T11:28:42Z")

</div>

Please let me know if the new code posted above is still not in correct format. Thanks. Regards

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [7 January 2019 11:51 UTC](https://discourse.nodered.org/t/url-variables-http-get-request/6484/7 "2019-01-07T11:51:57Z")

</div>

I'm not infront of my PC at the moment. But if you can copy from and paste into Node-RED it's in the correct format. If not please EDIT your post rather than posting again.
