# Headers response(solved)

**URL:** <https://forum.xojo.com/t/headers-response-solved/44038>\
**Category:** Getting Started\
**Created:** [June 22, 2018, 1:51pm UTC](https://forum.xojo.com/t/headers-response-solved/44038 "2018-06-22T13:51:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loannis\_Kolliageorgas](https://forum.xojo.com/letter_avatar_proxy/v4/letter/l/b2d939/32.png) [@Loannis\_Kolliageorgas](https://forum.xojo.com/u/Loannis_Kolliageorgas)\
**Post date:** [June 22, 2018, 1:51pm UTC](https://forum.xojo.com/t/headers-response-solved/44038/1 "2018-06-22T13:51:54Z")

</div>

I know this is easy but I have stuck 😃

I am using the Xojo.Net.HTTPSocket with Get and I want all the response headers to Textfield,with CURLSMBS is easy but I don’t know with Xojo.Net.HTTPSocket  
Can someone give me a small example how to ?  
Thank you

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [June 22, 2018, 2:39pm UTC](https://forum.xojo.com/t/headers-response-solved/44038/2 "2018-06-22T14:39:59Z")

</div>

Have-you put code in the HeadersReceived Event ?

Or used RequestHeader ?

I do that using Classic code; I had to use a loop to get all headers (and I put that in a TextField (or was it a TextArea ?), years ago.

---

<div class="post-metadata">

**Author:** ![Loannis\_Kolliageorgas](https://forum.xojo.com/letter_avatar_proxy/v4/letter/l/b2d939/32.png) [@Loannis\_Kolliageorgas](https://forum.xojo.com/u/Loannis_Kolliageorgas)\
**Post date:** [June 22, 2018, 2:43pm UTC](https://forum.xojo.com/t/headers-response-solved/44038/3 "2018-06-22T14:43:40Z")

</div>

Thank you Emile,no I don’t have any code in HeadersReceived Event.  
I don’t know what I put there because the manual have only have the “Called when headers are received from the server.”  
I know the headers have received, i don’t know how to fetch this data…

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [June 22, 2018, 3:01pm UTC](https://forum.xojo.com/t/headers-response-solved/44038/4 "2018-06-22T15:01:45Z")

</div>

I do not know where the project (where I used to request headers) resides, but I found a download log. Heres the relevant part:

`2018-02-10 19:27:27: Connected to the site.
2018-02-10 19:27:28: Headers were received.
Received Internet Headers (7) :
          1. Date: Sat, 10 Feb 2018 18:27:33 GMT
          2. Server: Apache
          3. Last-Modified: Mon, 19 Jun 2017 02:48:16 GMT
          4. Accept-Ranges: bytes
          5. Content-Length: 4998617
          6. Connection: close
          7. Content-Type: image/jpeg
2018-02-10 19:28:12: Item download complete.`

Lines prefixed 1 thru 7 are the Headers

Like you, I was lost, and usually, a quest in the internet helps.

Example:  
ResponseHeader(name As Text) As Text

Put the header you want data for in name, and read the answer (the Header) in the returned Text ?

You already have a project to make tests on.

Ypu may find information here: [https://www.tutorialspoint.com/http/http\_header\_fields.htm](https://www.tutorialspoint.com/http/http_header_fields.htm) useful.

In the Classic code, the returned information is either in an array or in text and I decode them like an array (this the 1-7 values in my returned headers lines).

What may also help (to understand my log extract) is Firefox. Load a web page (one), then issue ctrl-I or cmd-i and watch what is in the just opened window. You will recognize some data from the above log extract.

---

<div class="post-metadata">

**Author:** ![Loannis\_Kolliageorgas](https://forum.xojo.com/letter_avatar_proxy/v4/letter/l/b2d939/32.png) [@Loannis\_Kolliageorgas](https://forum.xojo.com/u/Loannis_Kolliageorgas)\
**Post date:** [June 22, 2018, 3:12pm UTC](https://forum.xojo.com/t/headers-response-solved/44038/5 "2018-06-22T15:12:06Z")

</div>

[quote=393139:@Emile Schwarz]I do not know where the project (where I used to request headers) resides, but I found a download log. Heres the relevant part:

`2018-02-10 19:27:27: Connected to the site.
2018-02-10 19:27:28: Headers were received.
Received Internet Headers (7) :
          1. Date: Sat, 10 Feb 2018 18:27:33 GMT
          2. Server: Apache
          3. Last-Modified: Mon, 19 Jun 2017 02:48:16 GMT
          4. Accept-Ranges: bytes
          5. Content-Length: 4998617
          6. Connection: close
          7. Content-Type: image/jpeg
2018-02-10 19:28:12: Item download complete.`

Lines prefixed 1 thru 7 are the Headers

Like you, I was lost, and usually, a quest in the internet helps.

Example:  
ResponseHeader(name As Text) As Text

Put the header you want data for in name, and read the answer (the Header) in the returned Text ?

You already have a project to make tests on.

Ypu may find information here: [https://www.tutorialspoint.com/http/http\_header\_fields.htm](https://www.tutorialspoint.com/http/http_header_fields.htm) useful.

In the Classic code, the returned information is either in an array or in text and I decode them like an array (this the 1-7 values in my returned headers lines).

What may also help (to understand my log extract) is Firefox. Load a web page (one), then issue ctrl-I or cmd-i and watch what is in the just opened window. You will recognize some data from the above log extract.[/quote]  
Thank you Emily now I figure out how to !!

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 7:15pm UTC](https://forum.xojo.com/t/headers-response-solved/44038/6 "2020-10-29T19:15:31Z")

</div>


