Keep-alive header with GET/POST request

dariesto

Client
Регистрация
03.11.2011
Сообщения
124
Благодарностей
9
Баллы
18
Hi

Is it possible to send GET/POST requests with "Connection: keep-alive" header as browser requests have?

Many thanks for any help.
 
Последнее редактирование:

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
Try this:
instance.SetHeader("Connection","keep-alive");
instance.SetHeader("KeepAlive","true");
 

dariesto

Client
Регистрация
03.11.2011
Сообщения
124
Благодарностей
9
Баллы
18
Thanks for reply, but browser already sends this by default, what I need to do is to send it with use http GET/POST request action, unfortunately there is no field for additional headers in this action, so maybe this is possible with use of C# code and http GET/POST request wich is described here
https://help.zennolab.com/en/v5/zennoposter/5.11.7.0/webframe.html#topic555.html

Thanks in advance for help in this matter.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 182
Баллы
113
Thanks for reply, but browser already sends this by default, what I need to do is to send it with use http GET/POST request action, unfortunately there is no field for additional headers in this action, so maybe this is possible with use of C# code and http GET/POST request wich is described here
https://help.zennolab.com/en/v5/zennoposter/5.11.7.0/webframe.html#topic555.html

Thanks in advance for help in this matter.

You can send additional headers with help of action also. Set it in Useragent field like in wiki: http://zennolab.com/wiki/en:actions:http
 

dariesto

Client
Регистрация
03.11.2011
Сообщения
124
Благодарностей
9
Баллы
18
Thanks a lot. Yes now it is sending "Connection: keep-alive" header and server responds with same header as confirmation but... as this keep-alive connection is established, there is no continuation in following requests, it looks like always new connection is set (server response is always with the same value of "max" in that header).

In comparison to request in browser each following request from browser has response with "max" value lowered by one like 99, 98, 97...etc, and requests from browser has header "Host: domain.com" (located above "User-Agent" header) and "Connection: keep-alive" is located under coookies, whereas using action http GET/POST request there is no "Host: domain.com" header and "Connection: keep-alive" is located under "User-Agent" header.

Are these differences in request headers could be the reason why, using GET/POST actions I cannot continue keep-alive connection with server?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 182
Баллы
113
Hi. Its really not that simple to answer. GET/POST requests are more specific and require some knowledge to make them properly.
Also not all sites allow GET and POST request to do some actions, also You have to scrape and use cookies if You want to make following get/post requests, just like browser handles that.

There can be lots of lots of parameters page sending and waiting answers, so You have to make sure You understand all and everything in those...
 

dariesto

Client
Регистрация
03.11.2011
Сообщения
124
Благодарностей
9
Баллы
18
Yes I understand, and as You mentioned, I have made http GET request with scraped cookies, website responds properly, the only thing is that it doesn't use keep-alive to maintain connection as browser requests do. In traffic monitor there are only two differences in reqest headers described before (Host header and headers order) I attached screenshot of those request from traffic monitor, also content policy in browser was configured so that only same single request was made from browser.

Therefore, is this possible to made request using GET/POST action or C# code action to use properly keep-alive header? Of course, I'm aware, if this is difficult and require some work to make it functioning, I would order it in the marketplace and pay for it.
 

Вложения

Кто просматривает тему: (Всего: 2, Пользователи: 0, Гости: 2)