Get page headers from a request

  • Автор темы Автор темы Parra
  • Дата начала Дата начала

Parra

Новичок
Регистрация
27.03.2018
Сообщения
25
Реакции
3
Баллы
3
Hello,

I have a page that run many requests.
Some of them uses a token. It is in the header of the requests and need to get that token into a variable.
I can see that token in traffic monitor but I need it in runtime.

Is there is a way to do that ?

Thank you,
Marcello
 
Yes, before visiting the site on the browser run this-
instance.UseTrafficMonitoring = true;

C#:
Развернуть Свернуть Копировать
var traffic = instance.ActiveTab.GetTraffic();
foreach(var t in traffic) {
    if (t.Url.Contains("the url that contains your headers")) {
        return t.Url;
        // it can also be t.RequestBody; etc.
    }
}
return "-";

Look in to UseTrafficMonitoring, there are many discussions about it.
 
Great
Worked fine
Thank you
 
  • Спасибо
Реакции: myndeswx

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