Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

vladiacob/go_requester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go_requester

Go requester is a package which is helping you to make HTTP requests easy than before.

Travis CI

Travis CI

Godoc

https://godoc.org/github.com/vladiacob/go_requester

How to install

go get github.com/vladiacob/go_requester

How to use

Include go_requester

include (
    ..
    requester "github.com/vladiacob/go_requester"
    ..
)

Initialize requester

requester := requester.New(http.DefaultClient)
requester.SerUserAgent("test")

Basic auth

requester.SetAuthentication("username", "password")

Make request

JSON response

var clientJSONResponse ClientResponse
response, err := requester.Make("GET", "http://localhost", map[string]string{}, &clientJSONResponse)

String response

var clientStringResponse string
response, err = requester.Make("GET", "http://localhost", map[string]string{}, &clientStringResponse)

Response

type Response struct {
    Status int
    Body   []byte
}

About

Package to make HTTP requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages