# Http request header and body

**URL:** <https://community.n8n.io/t/http-request-header-and-body/5415>\
**Category:** Questions\
**Created:** [April 23, 2021, 8:15am UTC](https://community.n8n.io/t/http-request-header-and-body/5415 "2021-04-23T08:15:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mezkalito](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mezkalito](https://community.n8n.io/u/mezkalito)\
**Post date:** [April 23, 2021, 8:15am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/1 "2021-04-23T08:15:17Z")

</div>

Hi there,  
I need to send data via https request to an API and did not get it on track. Perhaps you have a recommendation.

I have this PUT header (with some anonymisations :-)):  
PUT /kd\_1/api/V1/Profilcandidate HTTP/1.1  
Host: [myyyyyy.yyyyyyy.de](http://myyyyyy.yyyyyyy.de)  
Content-Type: application/json  
SubscriptionKey: yyyyyyyyyyyyy  
Cookie: ASP.NET\_SessionId=amvnsan5xhy20sxeuxdqxb4s; F5BigIP=!gyJ/pzpakRhJprJ0vD7SpFy8MsbEt6o7K/m0KbBaN0DWq+n4GyfKh734htUh5gbxBfDEYnJwqlw+9SoDiYGXwbjScSHCC6x4y9Es1sgV; TS016adc98=017a0f52b0cb90501b08d832606738d989b6179e413690b1d82fdd7d3463f42df9468165f37fea0244a679dff148704cf8fa1a784d  
Content-Length: 422

and this body:  
{  
“Country”: “DE”,  
“BewerberId”: “500845221”,  
“Kampagne”: “Test nexum 22/04/21”,  
“Source”: “”,  
“Answers”: [  
{  
“Key”: “VerfuegbarAb Value”,  
“Value”: “1”  
},  
{  
“Key”: “Entfernung”,  
“Value”: “300”  
},  
{  
“Key”: “GehaltswunschProMonat”,  
“Value”: “3000”  
}  
],  
“Dokuments”:   
}

And it put it into the fields with this settings! Without Auth because I have just the subscriptionkey in the header.  
[Bildschirmfoto 2021-04-23 um 10.10.35|645x500](https://community.n8n.io/uploads/short-url/y6oopZV0gqs10WsKedq98nHp4SM.png)

I put the header and body in the parameters field like mentioned above. But it is not working.

Thx and kind regards  
Sebastian

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [April 23, 2021, 8:18am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/2 "2021-04-23T08:18:53Z")

</div>

Hey hey @mezkalito!

Welcome to the community 🎉

Did you checked the documentation for the [HTTP Request](https://docs.n8n.io/nodes/n8n-nodes-base.httpRequest/) node? We also have a blog post explaining how to use the node, you can refer it here: [How to use the HTTP Request node](https://n8n.io/blog/how-to-use-the-http-request-node-the-swiss-army-knife-for-workflow-automation/)

---

<div class="post-metadata">

**Author:** ![mezkalito](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mezkalito](https://community.n8n.io/u/mezkalito)\
**Post date:** [April 23, 2021, 8:27am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/3 "2021-04-23T08:27:43Z")

</div>

Hi and thx for welcome me.  
I checked the docu, yes, but did not find exactly how to write the header and body in the right way. it seems to be the problem there.  
Or if I choose to use this settings below and do not now where to put the answers part from the json.

 ![Bildschirmfoto 2021-04-23 um 10.27.04](https://europe1.discourse-cdn.com/n8n/original/2X/8/88a44a1bba3229f14f62f34a9833fdf10eca00ac.png)

Thx and regards

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [April 23, 2021, 8:36am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/4 "2021-04-23T08:36:40Z")

</div>

Hey!

You can use the current settings that you have and add parameters for each item in your JSON object. Alternatively, you can toggle _ **JSON/RAW Parameter** _ to `true` (as shown in the image). This will provide you with text fields where you can enter your JSON object.

 ![Screenshot 2021-04-23 at 10.33.37 AM](https://europe1.discourse-cdn.com/n8n/original/2X/d/dbd40a1fb9e3dfdd6bf47256f8ffa83b7ea59bf0.png)

Let me know if you still have questions 🙂

---

<div class="post-metadata">

**Author:** ![mezkalito](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mezkalito](https://community.n8n.io/u/mezkalito)\
**Post date:** [April 23, 2021, 8:54am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/5 "2021-04-23T08:54:57Z")

</div>

All right.

But in the json i have values like Country and then values for with keys for answers. How do i set up this? This will be my last question then. 🙂 Sorry, I am a little bit lost with this API topics.

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [April 23, 2021, 9:34am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/6 "2021-04-23T09:34:55Z")

</div>

Hey!

Feel free to ask questions. I am more than happy to help 🙂

Here’s the HTTP Request node that you can use in your workflow. Make sure to change the values as per your needs.

You can copy the above code and paste it in the Editor UI.

---

<div class="post-metadata">

**Author:** ![mezkalito](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mezkalito](https://community.n8n.io/u/mezkalito)\
**Post date:** [April 23, 2021, 9:42am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/7 "2021-04-23T09:42:38Z")

</div>

Ah perfect. Thx a lot.  
Just to be clear. I use the complete node. and in which field do i have to fill it?

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [April 23, 2021, 9:50am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/8 "2021-04-23T09:50:15Z")

</div>

I would suggest you to take a look at following parameters and make sure they are correct:

- _ **Request Method** _ - Mistakenly, I have set to `POST`. Since you need to make a `PUT` request, please update it.
- _ **URL** _ - This is empty because I didn’t know which URL you want to access. Enter your URL in this field.
- _ **Body Parameters** _ - I have copy-pasted the body you shared. Please make changes to it if you want to make a request with different data
- _ **Headers** _ - You will need update this with correct data

Hope this answers your question 🙂

---

<div class="post-metadata">

**Author:** ![mezkalito](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mezkalito](https://community.n8n.io/u/mezkalito)\
**Post date:** [April 23, 2021, 10:00am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/9 "2021-04-23T10:00:26Z")

</div>

Not completely. I got, I have to change the some parts but do not now where to copy this node to.

I made it like this now but it does not work:

 ![Bildschirmfoto 2021-04-23 um 11.56.55](https://europe1.discourse-cdn.com/n8n/original/2X/8/8550a203c7f1c4b90afb31647dd5d796da826d1b.png)  
 ![Bildschirmfoto 2021-04-23 um 11.57.02](https://europe1.discourse-cdn.com/n8n/original/2X/1/1355cc84d2845856f47f275c7e8dd6928695a0d5.png)  
 ![Bildschirmfoto 2021-04-23 um 11.57.11](https://europe1.discourse-cdn.com/n8n/original/2X/0/050e3177029d3febd4f635a9877ea12989854434.png)

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [April 23, 2021, 10:03am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/10 "2021-04-23T10:03:29Z")

</div>

What is the error that you get?

---

<div class="post-metadata">

**Author:** ![mezkalito](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mezkalito](https://community.n8n.io/u/mezkalito)\
**Post date:** [April 23, 2021, 10:04am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/11 "2021-04-23T10:04:17Z")

</div>

it is loading and loading and i get no result

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [April 23, 2021, 11:10am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/12 "2021-04-23T11:10:45Z")

</div>

Hey @mezkalito,

Do you mind sharing me the URL and other data to make the call. Feel free to send it to me over a DM. The above solution should have worked. I will try to replicate the issue and try to get back with a working solution.

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [April 23, 2021, 11:54am UTC](https://community.n8n.io/t/http-request-header-and-body/5415/13 "2021-04-23T11:54:50Z")

</div>

Hey @mezkalito,

I removed the Cookie and the Content Length fields from the headers and I got a success response. I am not certain why this works, but it might depend on the way the API is designed.
