Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/reiver/go-simplehttp

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/reiver/go-simplehttp

  • v1.0.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

go-simplehttp

A library that provides a simple way of sending an HTTP (and HTTPS) response, for the Go programming language.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-simplehttp

GoDoc

Example

Sending a "200 OK" HTTP response.

simplehttp.OK(w)

Sending a "200 OK" HTTP response, with some data.

simplehttp.OK(w, struct{
    FullName string `json:"full_name"`
    Age      int    `json:"age"`
}{
    FullName: "Joe Blow",
    Age:      34,
})

Sending a "500 Internal Server Error" HTTP response.

simplehttp.InternalServerError(w)

Sending a "404 Not Found" HTTP response.

simplehttp.NotFound(w, map[string]interface{}{
    "message":   "What you are looking for is not here.", 
    "date_time": time.Now(),
})

FAQs

Package last updated on 02 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc