#discord #discord-api #twilight


Discord REST API client for the Twilight ecosystem

60 releases (8 breaking)

new 0.8.0 Dec 3, 2021
0.7.2 Nov 20, 2021
0.6.0 Jul 31, 2021
0.3.5 Mar 14, 2021
0.2.5 Nov 29, 2020

#11 in HTTP client

Download history 323/week @ 2021-08-15 195/week @ 2021-08-22 284/week @ 2021-08-29 146/week @ 2021-09-05 237/week @ 2021-09-12 263/week @ 2021-09-19 274/week @ 2021-09-26 262/week @ 2021-10-03 750/week @ 2021-10-10 360/week @ 2021-10-17 287/week @ 2021-10-24 449/week @ 2021-10-31 638/week @ 2021-11-07 670/week @ 2021-11-14 442/week @ 2021-11-21 765/week @ 2021-11-28

2,567 downloads per month
Used in 10 crates (7 directly)

ISC license

46K SLoC


codecov badge discord badge github badge license badge rust badge

HTTP support for the twilight ecosystem.


There are a few usage examples located in the root of the twilight repository.



The decompression feature enables brotli decompression support via the brotli crate.

This is enabled by default.


twilight-http supports serde_json and simd-json for deserializing responses.


The simd-json feature enables simd-json support to use simd features of modern cpus to deserialize responses faster. It is not enabled by default.

To use this feature you need to also add these lines to <project root>/.cargo/config:

rustflags = ["-C", "target-cpu=native"]

You can also set the environment variable RUSTFLAGS="-C target-cpu=native". If you enable both serde_json and simd-json at the same time, then simd-json will be used.

To enable simd-json, do something like this in your Cargo.toml:

twilight-http = { default-features = false, features = ["rustls", "simd-json"], version = "0.2" }


twilight-http has features to enable hyper's TLS features. These features are mutually exclusive. rustls is enabled by default.


The native feature enables hyper's default-tls feature, which is mostly equivalent to using native-tls.

To enable native, do something like this in your Cargo.toml:

twilight-http = { default-features = false, features = ["native"], version = "0.2" }


The rustls feature enables hyper's rustls feature, which uses rustls as the TLS backend.

This is enabled by default.


The tracing feature enables logging via the tracing crate.

This is enabled by default.


The trust-dns enables hyper-trust-dns, which replaces the default GaiResolver in hyper. hyper-trust-dns instead provides a fully async DNS resolver on the application level.


~282K SLoC