/
ilya.petrash
/
SimplePyScripts
Обзор
Документация
Войти
/
ilya.petrash
/
SimplePyScripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
http.server__examples/simple_http_proxy_server/test.py
26 строк
428 B
gil9red
Refactoring. Using black code style
25 май 2023, 10:00
25 май 2023, 10:00
4d9f347
Код
Авторство
О чём код?
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" import requests proxies = { "http": "localhost:33333", } url = "http://httpbin.org/headers" rs = requests.get(url, proxies=proxies) print(rs) print(rs.headers) print(rs.content) for header, value in rs.json()["headers"].items(): if header.lower().startswith("x-my"): print(f"{header}: {value!r}") """ ... X-My-Proxy: 'hell yeah!' """