# http request parameters

**URL:** https://discourse.nodered.org/t/http-request-parameters/22078
**Category:** General
**Created:** [22 February 2020 00:07 UTC](https://discourse.nodered.org/t/http-request-parameters/22078 "2020-02-22T00:07:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rex](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rex/32/59848_2.png) [@rex](https://discourse.nodered.org/u/rex)
#### Post date: [22 February 2020 00:07 UTC](https://discourse.nodered.org/t/http-request-parameters/22078/1 "2020-02-22T00:07:33Z")

</div>

I'm trying to set the right parameters for http request, but I'm not able to do it.  
The query with curl is this:  
curl -H "Content-Type: application/json" -X GET -d '{"auth\_key":"xf79rra", "payload":null}' [https://retepaiot.it/sensordata/0018b1213](https://retepaiot.it/sensordata/0018b1213)  
and it works.  
I think I made somethings wrong passing auth\_key and payload (they are not via URL).  
I use the function to prepare the message:  
_msg.headers = {_

- "Content-Type": "application/json"\*
- } \*  
_msg.payload = {};_  
\*msg.payload = {auth\_key:"xf79rra", \*
- payload:null};\*  
_return msg;_

and http request for URL:  
_[https://retepaiot.it/sensordata/0018b1213](https://retepaiot.it/sensordata/0018b1213)_

the returned message is:  
{ "message": "Failed to decode JSON object: Expecting value: line 1 column 1 (char 0)"}

Can I have some help?  
Thanks,  
Fabrizio

---

<div class="post-metadata">

### Author: ![alexk111](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alexk111/32/16891_2.png) [@alexk111](https://discourse.nodered.org/u/alexk111)
#### Post date: [23 February 2020 14:19 UTC](https://discourse.nodered.org/t/http-request-parameters/22078/2 "2020-02-23T14:19:58Z")

</div>

Can you post the function code using the preformatted text block:

```auto
msg.headers = { "your": "code" };

```

---

<div class="post-metadata">

### Author: ![rex](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rex/32/59848_2.png) [@rex](https://discourse.nodered.org/u/rex)
#### Post date: [24 February 2020 22:16 UTC](https://discourse.nodered.org/t/http-request-parameters/22078/3 "2020-02-24T22:16:23Z")

</div>

The problem is that the method GET, called from http request, doesn't manage the payload (body on http). Simply it ignores it (this is conforms to the protocol).  
The REST server isn't fully compliant with the GET method.  
For now, the unique solution I've found was to modify the node http request. Best if I rewrite it into a new node.

---

<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: [24 April 2020 22:16 UTC](https://discourse.nodered.org/t/http-request-parameters/22078/4 "2020-04-24T22:16:26Z")

</div>

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