requests

HTTP Requests for Golang.

Stars
12

Requests

Most existing requests packages I've seen reimplement all features requests offers. This Request inherits all the behavior and functions of http.Requests package and adds others functions and behaviors.

Features

  • Retries
  • Connection Timeouts
  • byte and json streams

Installation

To install Requests, simply:

$ go get github.com/leonmaia/requests

Usage

package whatever

import (
	"github.com/leonmaia/requests"
)

func GetExampleWithDefaultTimeoutAndRetries() error {
	r, err := requests.NewRequest("GET", "http://google.com", nil)
	if err != nil {
		return err
	}

	response, err := r.Do()
	if err != nil {
		return err
	}
	// Do whatever you want with the response
	return nil
}

How to Contribute

I strongly encourage everyone whom creates a usefull custom assertion function to contribute them and help make this package even better.

Make sure all the tests are passing, and that you have covered all the changes you made.