Skip to content

Commit

Permalink
Simple Readme.md
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Ortiz <[email protected]>
  • Loading branch information
cortiz committed Jun 20, 2024
1 parent 53690ad commit 30f75f9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
49 changes: 49 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Monica

Monica is designed to handle Network requests and responses.

## Features
* Parse raw HTTP requests and return a Request object.
* Send HTTP requests with custom headers and body.
* Parse HTTP responses, including headers and body.

## Usage
* Runs all `mon` files in the current directory
```bash
monica run
```
* Run a single file
```bash
monica run -s <file>
```

## Mon file format
Lines starting with `#` are considered comments and are ignored.
### HTTP Request
```
#Comment
HTTP METHOD URL
HEADERS
BODY
```

#### Example
```
# Simple HTTP Request
GET http://httpbin.org/status/200
Host: httpbin.org
User-Agent: monica/0.1.0
```

```
# Simple POST HTTP Request
GET http://httpbin.org/anything
Host: httpbin.org
User-Agent: monica/0.1.0
{
"key": "value"
}
```
8 changes: 8 additions & 0 deletions pkg/request/testdata/simple_post.mon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Simple POST HTTP Request
GET http://httpbin.org/anything
Host: httpbin.org
User-Agent: monica/0.1.0

{
"key": "value"
}

0 comments on commit 30f75f9

Please sign in to comment.