poster

package
v0.0.0-...-5a8c9f9 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2016 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

A package for mocking the JSON HTTP POST requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Poster

type Poster interface {
	// Create a POST request.
	Post(url string, r io.Reader) (*http.Response, error)
}

A Poster is an interface for creating JSON HTTP POST requests.

func Http

func Http() Poster

Create a Poster implementation with standart net/http library.

type PosterCloser

type PosterCloser interface {
	io.Closer
	Poster
}

func Handle

func Handle(h http.Handler) (PosterCloser, string)

Create a Poster implementation with standart net/http/httptest library that creates POST requests to a specific http.Handler.

You need to Close it after you're done. Close always returns nil for this implementation.

Jump to

Keyboard shortcuts

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