# Configuring HTTP Request for API call

**URL:** <https://discourse.nodered.org/t/configuring-http-request-for-api-call/95592>\
**Category:** General\
**Created:** [23 February 2025 14:33 UTC](https://discourse.nodered.org/t/configuring-http-request-for-api-call/95592 "2025-02-23T14:33:41Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [23 February 2025 15:05 UTC](https://discourse.nodered.org/t/configuring-http-request-for-api-call/95592/5 "2025-02-23T15:05:23Z")

</div>

Your flow is corrupt due to not posting code in the correct way

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

What is the response you get from the http resquest node?  
Did you try what I said?

[edit]  
The browser is a GET request but you set the http request to POST.  
To append the query string mag.payload needs to be a object.  
You do not require the JSON node, unless you want a JSON(string) returned rather than a Javascript object.

example flow

```auto
[{"id":"076b0c640872f1aa","type":"inject","z":"d1395164b4eec73e","name":"On","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Switch","payload":"{\"oid\":\"b05dd514\",\"prop\":\"command\",\"value\":\"off\"}","payloadType":"json","x":450,"y":5800,"wires":[["06748d9fc38754f0"]]},{"id":"06748d9fc38754f0","type":"http request","z":"d1395164b4eec73e","name":"Switch Extra","method":"GET","ret":"obj","paytoqs":"query","url":"http://192.168.1.118/iungo/api_request/object_prop_set","tls":"","persist":false,"proxy":"","insecureHTTPParser":true,"authType":"","senderr":false,"headers":[],"x":630,"y":5800,"wires":[["a69505ee9895d0ec","9ed11ab460e04bc0"]]},{"id":"a69505ee9895d0ec","type":"debug","z":"d1395164b4eec73e","name":"debug 8","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":880,"y":5720,"wires":[]},{"id":"9ed11ab460e04bc0","type":"debug","z":"d1395164b4eec73e","name":"debug 1","active":true,"tosidebar":false,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1000,"y":5800,"wires":[]}]

```

> [@JPHR](#):
>
> exactly what I described above with all those ? between headers.

What you call `headers` are properties of the query string. headers are a completely different thing.

---

_[View the full topic](https://discourse.nodered.org/t/configuring-http-request-for-api-call/95592)._
