Skip to content
forked from protiumx/rq

HTTP request parser written in rust

License

Notifications You must be signed in to change notification settings

TheRealLorenz/rq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rq

rq-core rq-cli

demo

demo generated with vhs

rq is an interactive HTTP client that parses and execute requests. It attempts to provide a minimal CLI alternative to vscode-restclient. rq follows the standard RFC 2616.

Original author blogpost: https://protiumx.github.io/blog/posts/an-http-request-parser-with-rust-and-pest-rs/

Installation

cargo install --path rq-cli

HTTP File

The pest grammar can be found here. You can use the pest editor to try it out and check how it works.

Explanation

-- request --
{request_line}\n
{header\n\n}*
{body\n}?

A request is conformed by: { request_line, headers, body}, where headers and body are optional matches.

  • request_line is conformed by: { method, target, version }.
    • method is one of GET, POST, PUT, DELETE (optional, defaults to GET).
    • target is the target url.
    • version is one of HTTP/0.9, HTTP/1.0, HTTP/1.1, HTTP/2.0, HTTP/3.0 (optional, defaults to HTTP/1.1)
  • headers is a collection of header { header_name, header_value } (optional).
  • body is anything that doesn't match headers and has a preceding line break, as specified in the RFC (optional).

About

HTTP request parser written in rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%