common/utils/http library

Functions

getRequest(Uri url, {Map<String, String> headers = const {}, bool debug = false, ProxyAPIConfig? proxyAPIConfig}) Future<String?>
GET request to fetch data from URL
getResponseHeaders(Uri url, {HttpMethod method = HttpMethod.get, Object? body, Map<String, String> headers = const {}, bool debug = false, ProxyAPIConfig? proxyAPIConfig}) Future<Map<String, String>?>
Makes a request and returns the response headers instead of the body.
postRequest(Uri url, {Object? body, Map<String, String> headers = const {}, bool debug = false, ProxyAPIConfig? proxyAPIConfig}) Future<String?>
POST request to fetch data from URL
throwIfNotFound(int statusCode, Uri url, bool debug) → void
Throws a WebScraperError with statusCode 404 when a response indicates the URL no longer exists. Other status codes are left to the caller.