request

package
v0.0.0-...-0fda7bc Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2016 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Request package provides the request structure The package provides access to Headers, Cookies Query Params, Post Body and Upload Files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Name     string
	FormName string
	Reader   *multipart.Part
}

Contains the reader to read the buffer content of uploading file

type Request

type Request struct {
	Header map[string]string
	Method string
	URL    string

	Params  map[string]string // a map to be filled by router
	Query   map[string][]string
	Body    map[string][]string
	Cookies *cookie.Cookie
	JSON    *json.Decoder
	// contains filtered or unexported fields
}

Request Structure

func (*Request) GetFile

func (req *Request) GetFile() *File

In case of file upload request, this function returns a file struct to read

func (*Request) GetRaw

func (req *Request) GetRaw() *http.Request

Helper that returns original raw http.Request object

func (*Request) GetUrl

func (req *Request) GetUrl() *url.URL

Returns the URL structure

func (*Request) Init

func (req *Request) Init(request *http.Request) *Request

type Url

type Url struct {
	Username string
	Password string
	Url      string
	Path     string
	Fragment string
}

Jump to

Keyboard shortcuts

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