fetch

package module
v0.0.0-...-57619b5 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2016 License: LGPL-3.0 Imports: 3 Imported by: 2

README

Build Status GoDoc Built with Spacemacs

golibri/fetch

Get and normalize textual content from URLs. Does a few things that go's stdlib doesn't:

  • normalize URLs before executing a request (missing http://, beginning with //, ...)
  • normalize response buffer to a valid UTF-8 string (ToDo)

installation

go get github.com/golibri/fetch

usage

page, err := fetch.Get("http://blog.golang.org/go1.5")
normalized_url := page.Url
content_string := page.Body

license

LGPLv3. (You can use it in commercial projects as you like, but improvements/bugfixes must flow back to this lib.)

Documentation

Overview

GET the HTML content of a URL as an UTF-8 string

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page struct {
	Url  string
	Body string
}

contains normalized url and the response body string

func Get

func Get(url string) (Page, error)

Perform a HTTP GET request, return struct with UTF-8 body

Jump to

Keyboard shortcuts

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