Minimal Rust HTTP client for both native and WASM

Related tags

HTTP Client ehttp
Overview

ehttp: a minimal Rust HTTP client for both native and WASM

Latest version Documentation unsafe forbidden Build Status MIT Apache

If you want to do HTTP requests and are targetting both native and web (WASM), then this is the crate for you!

You can try the web demo here (works in any browser with WASM and WebGL support). Uses egui_web.

Comments
  • Test app crashes

    Test app crashes

    cargo run --release -p example_eframe
        Finished release [optimized] target(s) in 0.05s
         Running `/home/user/Desktop/ehttp/target/release/example_eframe`
    [xcb] Unknown sequence number while processing queue
    [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
    [xcb] Aborting, sorry about that.
    example_eframe: xcb_io.c:269: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
    [1]    21354 abort (core dumped)  cargo run --release -p example_eframe
    
    rustup --version
    rustup 1.24.3 (2021-06-08)
    info: This is the version for the rustup toolchain manager, not the rustc compiler.
    info: The currently active `rustc` version is `rustc 1.57.0-nightly (e1e9319d9 2021-10-14)`
    
    cargo --version                      
    cargo 1.57.0-nightly (c7957a74b 2021-10-11)
    
    opened by XakepSDK 2
  • How to do callback in fetch function

    How to do callback in fetch function

    I wanted to use ehttp for a project of mine where I need to make a request (no use of async/await), get the response text from that request, and deserialize it with Serde. I am having some trouble finding a way to get the response value outside of the callback closure in the fetch function so I can pass the response text into Serde. Is there any way to do this?

    opened by leafjolt 1
  • Web fetch failure

    Web fetch failure

    • Repro: go to https://emilk.github.io/egui/#http and enter https://i.redd.it/un44882dvyj21.jpg.
    • Resulting error: JsValue(TypeError: NetworkError when attempting to fetch resource.)

    Expected success, or at least a better error message.

    opened by emilk 1
  • Documentation for HTTPS Request with cookie?

    Documentation for HTTPS Request with cookie?

    Would it be possible to get some documentation on how to connect ehttp to perform https requests submitted with cookies, and how those cookies can be set via the response? Thanks!

    opened by rustrust 0
  • Keep `ureq::Agent` for native clients

    Keep `ureq::Agent` for native clients

    I love the simple API of this crate! It can be useful if ehttp supports saving cookies, such as login function. Currently, the "agent" (ureq::Agent type) is not continuous between each request.

    A cross-platform and object-oriented example might look like this:

    pub struct Agent {
        #[cfg(not(target_arch = "wasm32"))]
        agent: ureq::Agent,
    }
    
    // save the session if we need (compatible syntax)
    let session = Agent::new();
    session.fetch(req, |r| match r {
        Ok(r) if r.ok => alert("Login successfully!"),
        _ => alert("Login failed!"),
    });
    
    // original "fetch" function
    fetch(req, |r| match r {
        Ok(r) if r.ok => alert("Login successfully!"),
        _ => alert("Login failed!"),
    });
    
    opened by KmolYuan 0
Releases(0.1.0)
Owner
Emil Ernerfeldt
Rust coder at Embark Studios. Previously worked with physics simulation, games, 3D scanning and cyber security. I am @ernerfeldt on Twitter
Emil Ernerfeldt
An easy and powerful Rust HTTP Client

reqwest An ergonomic, batteries-included HTTP Client for Rust. Plain bodies, JSON, urlencoded, multipart Customizable redirect policy HTTP Proxies HTT

Sean McArthur 6.8k Dec 31, 2022
FeignHttp is a declarative HTTP client. Based on rust macros.

FeignHttp is a declarative HTTP client. Based on rust macros. Features Easy to use Asynchronous request Configurable timeout settings Suppor

null 46 Nov 30, 2022
Pretend is a macros-based declarative Rust HTTP client

pretend is a modular, Feign-inspired HTTP, client based on macros. It's goal is to decouple the definition of a REST API from it's implementation.

null 24 Aug 3, 2022
HTTPie: human-friendly CLI HTTP client for the API era

HTTPie: human-friendly CLI HTTP client for the API era HTTPie (pronounced aitch-tee-tee-pie) is a command-line HTTP client. Its goal is to make CLI in

null 25.4k Dec 30, 2022
rh: user-friendly command-line HTTP client

Rust HTTP Cli The command name in your terminal is rh. rh: user-friendly command-line HTTP client rh is a user-friendly, lightweight and performant co

null 8 Nov 30, 2022
Fast and friendly HTTP server framework for async Rust

Tide Serve the web API Docs | Contributing | Chat Tide is a minimal and pragmatic Rust web application framework built for rapid development. It comes

http-rs 4.1k Jan 2, 2023
xh is a friendly and fast tool for sending HTTP requests. It reimplements as much as possible of HTTPie's excellent design, with a focus on improved performance.

xh is a friendly and fast tool for sending HTTP requests. It reimplements as much as possible of HTTPie's excellent design, with a focus on improved performance

Mohamed Daahir 3.4k Jan 6, 2023
An HTTP library for Rust

hyper A fast and correct HTTP implementation for Rust. HTTP/1 and HTTP/2 Asynchronous design Leading in performance Tested and correct Extensive produ

null 11k Jan 8, 2023
Pyre - A fast python HTTP server inspired by japronto written in rust.

Pyre - A fast python HTTP server inspired by japronto written in rust.

null 135 Nov 26, 2022
ratpack: a simpleton's HTTP framework (for rust-lang)

ratpack: a simpleton's HTTP framework (for rust-lang) ratpack is idealized in the simplicity of the sinatra (ruby) framework in its goal, and attempts

ZeroTier, Inc. 5 Jun 29, 2022
A backend providing a HTTP REST like interface for uploading files written in rust.

UploadServer A backend providing a HTTP REST like interface for uploading files written in rust. API Documentation License This project is licensed un

null 4 Nov 20, 2022
🐱‍👤 Drop-in HTTP replacement module for Garry's Mod

??‍?? gmsv_reqwest This module is a drop-in replacement for Garry's Mod's HTTP function, inspired by gmsv_chttp created by timschumi. The module uses

William 38 Dec 12, 2022
Multi-stream HTTP downloader using range requests

chooch - An Amazing Project Downloads files faster than wget/curl (in theory) using multiple connections. Chooch recycles the slowest connection and r

null 13 Sep 14, 2022
Wrapper around reqwest to allow for client middleware chains.

reqwest-middleware A crate implementing a wrapper around reqwest to allow for client middleware chains. Overview The reqwest-middleware client exposes

TrueLayer 113 Dec 7, 2022
Typed, correct GraphQL requests and responses in Rust

graphql_client A typed GraphQL client library for Rust. Features Precise types for query variables and responses. Supports GraphQL fragments, objects,

GraphQL Rust 914 Dec 27, 2022
🕵️Scrape multiple media providers on a cron job and dispatch webhooks when changes are detected.

Jiu is a multi-threaded media scraper capable of juggling thousands of endpoints from different providers with unique restrictions/requirements.

Xetera 47 Dec 6, 2022
Rust bindings to libcurl

curl-rust libcurl bindings for Rust Quick Start use std::io::{stdout, Write}; use curl::easy::Easy; // Print a web page onto stdout fn main() {

Alex Crichton 882 Dec 31, 2022
A GraphQL server library implemented in Rust

A GraphQL server library implemented in Rust Async-graphql is a high-performance server-side library that supports all GraphQL specifications. Feature

null 2.6k Jan 8, 2023
A rule34 scraper made in rust this time

rust-34-scraper A rule34 scraper made in rust this time Building Clone the repository Execute cargo build --release --release is an optimized build pr

null 3 Jun 10, 2022