Skip to content
This repository has been archived by the owner on Mar 1, 2019. It is now read-only.

brettbuddin/httpie

Repository files navigation

HTTPie

A small HTTP library for Go. It helps with normal HTTP requests and HTTP streaming.

Example Usage

package main

import (
    "fmt"
    "net/url"
    "github.com/brettbuddin/httpie"
)

func main() {
    // Create a GET endpoint
    endpoint := httpie.Get{&url.URL{
        Scheme: "http",
        Host: "google.com",
        Path: "/robots.txt",
    }}

    // We could alternatively, if we don't need auth, set this to nil
    authorizer := httpie.BasicAuth{"username", "password"}

    // Do the business
    client := httpie.NewClient(authorizer)
    resp, err := client.Request(endpoint)

    if err != nil {
        fmt.Printf("We have an error: %s\n", err)
        return
    }

    fmt.Printf("Our response: %s\n", resp)
}

About

Small HTTP library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages