Request modülü istek gönderme

Merhabalar,
Örnek olarak Burp-Suite ile bu şekilde bi istek yakaladığımı düşünelim

POST /controller/action_login.php HTTP/1.1
Host: yeni.isleronline.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
Accept: */*
Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 209
Origin: https://yeni.isleronline.com
Connection: close
Referer: https://yeni.isleronline.com/login.php
Cookie: email=asdasdsad@gmail.com; PHPSESSID=21312sadsaf123da

action=add-member&_sinif=&_okulListe=&_brans=&_ilce=257&_il=16&_okul=14569&_name=adsdad&_email=asdasdasddadsadsa%40gmail.com&_cinsiyet=1&_phone=0(532)+610-21-32&_corpCheck=1&_level=&_sube=&_student_number=2312

bunu python ile nasıl gönderebilirim yada göndermem mümkün mü ?

Mumkun. POST ile action arasindaki her sey header. action da form data herhalde.

1 Beğeni

Merhaba bu şekilde de kullabilirsin “Header” data yada payload olarak istediğin bilgileride basitçe post ve get ile gönderebilirsin. Umarım yardımcı olur.

import requests
url = "https://www.postveyagetyapılacakadres.com/"  #>> https://www.postedilecekurl.com
header={
"Host":"yeni.isleronline.com",
 "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0",
 "Accept":"*/*",
 "Accept-Language":"tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3",
 "Accept-Encoding":"gzip, deflate",
 "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",
 "X-Requested-With":"XMLHttpRequest",
 "Content-Length":"209",
 "Origin":"https://yeni.isleronline.com",
 "Connection":"close",
 "Referer":"https://yeni.isleronline.com/login.php",
 "Cookie":"email=asdasdsad@gmail.com; PHPSESSID=21312sadsaf123da"
}
data = {
"user":"kullanici",
"pass":"1234",
"id":122332
}
1 Beğeni