Python request maker
GET
POST
Follow redirects
https://withphp.com/
Host: withphp.com Cache-control: no-cache Content-Type: application/x-www-form-urlencoded User-Agent: prm Accept: */*
username: admin password: admin
Copy code
how to use
Other useful stuff
HTTP multipart file upload form:
POST /api/upload HTTP/1.1 Host: www.example.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW Content-Length: 872 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="name" John Doe ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="email" johndoe@example.com ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file"; filename="image.gif" Content-Type: image/gif GIF8a ------WebKitFormBoundary7MA4YWxkTrZu0gW--
HTTP multipart file upload (Python):
import requests url = "https://www.example.com/api/upload" files = {"file": ("image.jpg", open("image.jpg", "rb"), "image/jpeg")} response = requests.post(url, files=files) if response.status_code == 200: print("File uploaded successfully.") else: print("File upload failed.")