Skip to content
partial http/1.0 client and server implementations
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assignments
httpc
httpfs
test
.gitignore
LICENSE
README.md
client.go
go.mod
headers.go
request.go
response.go
server.go
status.go

README.md

http

This project contains solutions for the first two 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.

The ./httpc and ./httpfs 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] URL

Flags:
   -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] URL

Flags:
   -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 ".").
You can’t perform that action at this time.