dbg_as_curl

Crates.iodbg_as_curl
lib.rsdbg_as_curl
version1.0.0
sourcesrc
created_at2019-08-18 20:39:29.16473
updated_at2019-08-18 20:39:29.16473
descriptionA crate to help debugging reqwest
homepage
repositoryhttps://gitlab.com/mcarton/dbg_as_curl
max_upload_size
id157927
size20,347
Martin Carton (mcarton)

documentation

README

dbg_as_curlBuild Status Latest Version Documentation

A simple helper to get a cURL command line for your reqwest calls:

let client = reqwest::Client::new();

dbg_as_curl!(
    client.get("https://example.org").bearer_auth("foo")
).send()?;

It works the same way as the standard dbg! macro, but will print a command line that you can copy&paste to execute a reqwest call yourself:

[tests/tests.rs:4] client.get("http://example.org").bearer_auth("foo") = curl --header 'authorization: Bearer foo' 'http://example.org/'
Commit count: 10

cargo fmt