schttp

package
v0.0.0-...-85a12fc Latest Latest
Warning

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

Go to latest
Published: May 21, 2018 License: LGPL-3.0 Imports: 7 Imported by: 2

Documentation

Overview

Author:

Carlos Timoshenko
carlostimoshenkorodrigueslopes@gmail.com

https://github.com/softctrl

This project is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

Author:

Carlos Timoshenko
carlostimoshenkorodrigueslopes@gmail.com

https://github.com/softctrl

This project is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

Index

Constants

Common HTTP methods.

Unless otherwise noted, these are defined in RFC 7231 section 4.3.

View Source
const DEFAULT_TIMEOUT = time.Second * 200

Variables

View Source
var HTTP_100 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_101 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_102 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_103 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_1xx = StatusCodeRange{/* contains filtered or unexported fields */}
View Source
var HTTP_200 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_201 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_202 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_203 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_204 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_205 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_206 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_207 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_208 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_226 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_2xx = StatusCodeRange{/* contains filtered or unexported fields */}
View Source
var HTTP_300 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_301 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_302 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_303 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_304 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_305 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_306 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_307 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_308 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_3xx = StatusCodeRange{/* contains filtered or unexported fields */}
View Source
var HTTP_400 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_401 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_402 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_403 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_404 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_405 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_406 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_407 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_408 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_409 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_410 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_411 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_412 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_413 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_414 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_415 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_416 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_417 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_421 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_422 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_423 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_424 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_426 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_428 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_429 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_431 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_451 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_4xx = StatusCodeRange{/* contains filtered or unexported fields */}
View Source
var HTTP_500 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_501 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_502 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_503 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_504 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_505 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_506 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_507 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_508 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_510 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_511 = StatusCode{/* contains filtered or unexported fields */}
View Source
var HTTP_5xx = StatusCodeRange{/* contains filtered or unexported fields */}

Functions

func Delete

func Delete(__url string) ([]byte, error)

Performs a DELETE in a URL

func Get

func Get(__url string) ([]byte, error)

Performs a GET in a URL

func Perform

func Perform(__command Method, __url string, __body []byte, __header http.Header) (string, int, []byte, error)

Generic HTTP perform method.

func Post

func Post(__url string) ([]byte, error)

Performs a POST in a URL

func PostBody

func PostBody(__url string, __body []byte) ([]byte, error)

Performs a POST in a URL with a body.

func PostForm

func PostForm(__url string, __body url.Values) ([]byte, error)

Performs a POST into a URL

func Put

func Put(__url string) ([]byte, error)

Performs a PUT in a URL

Types

type Method

type Method string

func MethodFromString

func MethodFromString(__method string) Method

MethodFromString returns a Method instance from an informed string.

type Methods

type Methods []Method

type StatusCode

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

Based on: http://www.iana.org/assignments/http-status-codes

func (*StatusCode) Code

func (__obj *StatusCode) Code() int

func (*StatusCode) Desc

func (__obj *StatusCode) Desc() string

func (*StatusCode) RFC

func (__obj *StatusCode) RFC() string

type StatusCodeRange

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

func StatusCodeRangeFromString

func StatusCodeRangeFromString(__value string) *StatusCodeRange

func (*StatusCodeRange) Desc

func (__obj *StatusCodeRange) Desc() string

func (*StatusCodeRange) Max

func (__obj *StatusCodeRange) Max() int

func (*StatusCodeRange) Min

func (__obj *StatusCodeRange) Min() int

func (*StatusCodeRange) RFC

func (__obj *StatusCodeRange) RFC() string

Jump to

Keyboard shortcuts

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