Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g-harel/http
partial http/1.0 client and server implementations
https://github.com/g-harel/http
client file-server http
Last synced: 14 days ago
JSON representation
partial http/1.0 client and server implementations
- Host: GitHub
- URL: https://github.com/g-harel/http
- Owner: g-harel
- License: mit
- Created: 2018-09-05T22:17:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-28T19:31:38.000Z (about 6 years ago)
- Last Synced: 2024-11-16T11:15:08.247Z (3 months ago)
- Topics: client, file-server, http
- Language: Go
- Homepage:
- Size: 2.9 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# http
[![](https://godoc.org/github.com/g-harel/http?status.svg)](http://godoc.org/github.com/g-harel/http)
_This project contains solutions for the [first two assignments](./assignments) for the `Data Communications & Computer Networks` course._
The parent directory is a package exposing partial `http/1.0` client and server implementation similar to [`net/http`](https://golang.org/pkg/net/http/).
The [`./httpc`](./httpc) and [`./httpfs`](./https) directories contain a _curl-like_ command line tool and a simple file server respectively.
## httpc
```
$ go get -u github.com/g-harel/http/httpc
```#### get
```
Executes a HTTP GET request for a given URL.Usage:
httpc get [-v] [-h key:value] [-o filename] URLFlags:
-v Prints the detail of the response such as protocol, status, and headers.
-h key:value Associates headers to HTTP Request with the format 'key:value'.
-o filename Writes response body to specified file.
```#### post
```
Executes a HTTP POST request for a given URL with inline data or from file.Usage:
httpc post [-v] [-h key:value] [-d inline-data] [-f file] [-o filename] URLFlags:
-v Prints the detail of the response such as protocol, status, and headers.
-h key:value Associates headers to HTTP Request with the format 'key:value'.
-d string Associates an inline data to the body HTTP POST request.
-f filename Associates the content of a file to the body HTTP POST request.
-o filename Writes response body to specified file.
```_Either `-d` or `-f` can be used but not both._
## httpfs
```
$ go get -u github.com/g-harel/http/httpfs
``````
Starts a simple file server.Usage:
httpfs [-v] [-p port] [-d directory]Flags:
-v Prints debugging messages.
-p port Specifies the port for the server to listen to (default "8080").
-d directory Specifies the file server's root directory (default ".").
```