Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrbrmstr/construe
🧰 HTTP Request, Response and URL Parser
https://github.com/hrbrmstr/construe
http-parser r rstats
Last synced: 2 months ago
JSON representation
🧰 HTTP Request, Response and URL Parser
- Host: GitHub
- URL: https://github.com/hrbrmstr/construe
- Owner: hrbrmstr
- License: other
- Created: 2020-08-28T15:18:58.000Z (over 4 years ago)
- Default Branch: batman
- Last Pushed: 2020-09-01T03:02:17.000Z (over 4 years ago)
- Last Synced: 2024-08-03T22:18:17.420Z (4 months ago)
- Topics: http-parser, r, rstats
- Language: C++
- Homepage: https://cinc.rud.is/web/packages/construe/
- Size: 81.1 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - hrbrmstr/construe - 🧰 HTTP Request, Response and URL Parser (C++)
README
---
output: rmarkdown::github_document
editor_options:
chunk_output_type: console
---
```{r pkg-knitr-opts, include=FALSE}
hrbrpkghelpr::global_opts()
``````{r badges, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::stinking_badges(branch = "batman")
``````{r description, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::yank_title_and_description()
```## What's Inside The Tin
The following functions are implemented:
```{r ingredients, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::describe_ingredients()
```## Installation
```{r install-ex, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::install_block()
```## Usage
```{r lib-ex}
library(construe)# current version
packageVersion("construe")```
### Requests
```{r ex01}
paste0(c(
"GET /uri.cgi HTTP/1.1\r\n",
"User-Agent: Mozilla/5.0\r\n",
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n",
"Host: 127.0.0.1\r\n", "\r\n"
), collapse = "") -> reqreq_raw <- charToRaw(req)
parse_request(req)
parse_request_raw(req_raw)
microbenchmark::microbenchmark(
parse_request = parse_request(req),
parse_request_raw = parse_request_raw(req_raw)
)
```### Responses
```{r ex02}
paste0(c(
"HTTP/1.1 200 OK\r\n",
"Server: nginx/1.2.1\r\n",
"Content-Type: text/html\r\n",
"Content-Length: 8\r\n",
"Connection: keep-alive\r\n",
"\r\n",
"