httplib

package module
v0.0.0-...-3cbb2f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2012 License: MIT Imports: 10 Imported by: 0

README

About

httplib.go is a simple extension of Go's http client that provides a nice fluid interface for building HTTP requests

Installation

go get github.com/hoisie/httplib

Usage

This is a small usage example:

package main

import "github.com/hoisie/httplib"

//get the google home page
c := new(httplib.Client)
resp, err := c.Request ("http://google.com", "GET", nil, "")
data := ioutil.ReadAll( resp.Body )
println(string(data))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

type HttpRequestBuilder

type HttpRequestBuilder struct {
	// contains filtered or unexported fields
}

func Delete

func Delete(url string) *HttpRequestBuilder

func Get

func Get(url string) *HttpRequestBuilder

func Post

func Post(url string) *HttpRequestBuilder

func Put

func Put(url string) *HttpRequestBuilder

func (*HttpRequestBuilder) AsBytes

func (b *HttpRequestBuilder) AsBytes() ([]byte, error)

func (*HttpRequestBuilder) AsFile

func (b *HttpRequestBuilder) AsFile(filename string) error

func (*HttpRequestBuilder) AsResponse

func (b *HttpRequestBuilder) AsResponse() (*http.Response, error)

func (*HttpRequestBuilder) AsString

func (b *HttpRequestBuilder) AsString() (string, error)

func (*HttpRequestBuilder) Body

func (b *HttpRequestBuilder) Body(data interface{}) *HttpRequestBuilder

func (*HttpRequestBuilder) Close

func (b *HttpRequestBuilder) Close()

func (*HttpRequestBuilder) Header

func (b *HttpRequestBuilder) Header(key, value string) *HttpRequestBuilder

func (*HttpRequestBuilder) Param

func (b *HttpRequestBuilder) Param(key, value string) *HttpRequestBuilder

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL