fsolver
An easy to use, asynchronous wrapper for FlareSolverr.
Requirements
- An instance of FlareSolverr running on your machine or a server. For more information on how to set up FlareSolverr, visit the official repository.
Installation
# With default features (only `async`)
# With all features (`async` and `blocking`)
# Only blocking
Usage
For more info, visit the documentation.
Async
use FlareSolverrAsync;
// Setup the flare solver instance with default settings
let solver = new
.await
.unwrap;
// With custom ip and port
let solver = new
.await
.unwrap;
// Use different http schema
use HttpSchema;
let solver = new
.await
.unwrap;
// If you want some additional headers
use HashMap;
let mut headers = new;
headers.insert;
let solver = new
.await
.unwrap;
// When (for whatever the reason) flaresolverr changes /v1 endpoint
let solver = new
.await
.unwrap;
// List all sessions
let sessions: = solver.sessions.await.unwrap;
// List sessions and get response raw
let sessions: SessionListResponse = solver.sessions.await.unwrap;
// Create a new session with a random UUID
let session_id = solver.create_session.await.unwrap;
// Create a new session with a custom name/ID
let session_id = "myses";
let session_id = solver.create_session.await.unwrap;
// Delete/destroy a session
solver.destroy_session.await.unwrap;
// Get request
use RequestGet;
let session_id = solverr.create_session.await.unwrap;
let get_request_params = new;
let response: GetPostRequestResponse = solver.request_get.await.unwrap
// Post request
use RequestPost;
let post_request_params = new_empty
let response: GetPostRequestResponse = solver.request_post.await.unwrap;
Blocking
use FlareSolverrBlocking;
// Yep, just that. All functions are the same. Call functions without await.