impit
stableMake HTTP/1.1, HTTP/2, and HTTP/3 requests with browser-like TLS fingerprinting via a persistent client handle.
use plugin impit::{Impit.new, get, post, …} Functions (11)
- Impit.new Create a new HTTP client
- get Send a GET request
- post Send a POST request
- put Send a PUT request
- patch Send a PATCH request
- delete Send a DELETE request
- head Send a HEAD request
- options Send an OPTIONS request
- trace Send a TRACE request
- multipart_boundary Get a fingerprint-appropriate boundary string
- fingerprints List all built-in browser fingerprint names
Create a new HTTP client
Creates a new HTTP client. The optional config table accepts:
browser/fingerprint— browser name string (e.g."chrome_142") or custom fingerprint tableproxy— proxy URL stringignore_tls_errors— boolfallback_to_vanilla— bool, fall back to plain TLS if fingerprinting failshttp3— bool, enable HTTP/3redirect— int (max redirects) or"manual"cookie_store— bool, enable cookie jartimeout_ms— int milliseconds or"none"headers— default headers table
use plugin impit::{Impit}
let client = Impit.new()
let resp = client.get("https://httpbin.org/get")
print(resp.status())
use plugin impit::{Impit}
let client = Impit.new(#{"browser": "chrome_142", "timeout_ms": 5000})
let resp = client.get("https://example.com")
print(resp.ok())
Send a GET request
Sends a GET request. The optional opts table accepts headers, timeout_ms, body, and http3.
use plugin impit::{Impit}
let client = Impit.new()
let resp = client.get("https://httpbin.org/json")
let data = resp.json()
print(data["slideshow"]["title"])
Send a POST request
Sends a POST request. Pass the body in opts.body (string or bytes).
use plugin impit::{Impit}
let client = Impit.new()
let resp = client.post("https://httpbin.org/post", #{
"body": '{"name":"Alice"}',
"headers": #{"Content-Type": "application/json"}
})
print(resp.status())
Send a PUT request
Sends a PUT request with an optional body in opts.body.
use plugin impit::{Impit}
let client = Impit.new()
let resp = client.put("https://api.example.com/items/1", #{
"body": '{"done":true}',
"headers": #{"Content-Type": "application/json"}
})
print(resp.status())
Send a PATCH request
Sends a PATCH request for partial resource updates.
use plugin impit::{Impit}
let client = Impit.new()
let resp = client.patch("https://api.example.com/users/42", #{
"body": '{"active":false}'
})
print(resp.status())
Send a DELETE request
Sends a DELETE request.
use plugin impit::{Impit}
let client = Impit.new()
let resp = client.delete("https://api.example.com/items/1")
print(resp.status())
Send a HEAD request
Sends a HEAD request — retrieves headers without downloading the body.
use plugin impit::{Impit}
let client = Impit.new()
let resp = client.head("https://example.com")
print(resp.header("Content-Type"))
Send an OPTIONS request
Sends an OPTIONS request to check allowed methods for a resource.
use plugin impit::{Impit}
let client = Impit.new()
let resp = client.options("https://api.example.com/items")
print(resp.header("Allow"))
Send a TRACE request
Sends a TRACE request for diagnostic loop-back testing.
Get a fingerprint-appropriate boundary string
Returns a fingerprint-appropriate multipart boundary string for building multipart/form-data bodies.
use plugin impit::{Impit}
let client = Impit.new(#{"browser": "firefox_137"})
let boundary = client.multipart_boundary()
print(boundary)
List all built-in browser fingerprint names
Returns a list of all built-in browser fingerprint names that can be passed to Impit.new.
use plugin impit::{fingerprints}
let names = fingerprints()
print(names[1])