forked from jjlopez/descargar-cfdi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Header.py
32 lines (29 loc) · 1.23 KB
/
Header.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class Header:
def obtener(self, host, referer):
encabezado = {
'Accept':' text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding':'gzip, deflate',
'Accept-Language':'en-US,en;q=0.5',
'Connection':'keep-alive',
'Host':host,
'Referer':referer,
'User-Agent':'Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0',
'Content-Type':'application/x-www-form-urlencoded',
}
return encabezado
def obtenerAJAX(self, host, referer):
encabezado = {
'Accept':' text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding':'gzip, deflate',
'Accept-Language':'en-US,en;q=0.5',
'Cache-Control':'no-cache',
'Connection':'keep-alive',
'Host':host,
'Referer':referer,
'User-Agent':'Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0',
'Content-Type':'application/x-www-form-urlencoded',
'X-MicrosoftAjax':'Delta=true',
'x-requested-with':'XMLHttpRequest',
'Pragma':'no-cache'
}
return encabezado