golang-response-examples

command module
v0.0.0-...-03b6941 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2014 License: GPL-3.0 Imports: 7 Imported by: 0

README

golang-response-examples

Golang examples with several client\server responses.

Minimal

Simple minimal Golang web-server

go run minimal.go

Visit http://127.0.0.1:8080/My-Name

Header

Set the header on Golang web-server

go run header.go

curl -i localhost:8080

Redirect

Redirect response

go run redirect.go

Visit *http://127.0.0.1:8080/redirect"

JSON

Response with simple JSON from struct

go run json.go

Visit *http://127.0.0.1:8080"

XML

Response with simple XML from struct

go run xml.go

Visit *http://127.0.0.1:8080"

File

Serve a file

go run file.go

Visit *http://127.0.0.1:8080"

Template

Simple HTML Response using template

go run template.go

Visit *http://127.0.0.1:8080"

Nested Templates

Nested Templates response

go run nested.go

Visit *http://127.0.0.1:8080"

Form

HTML Form POST and Response

go run form.go

Visit *http://127.0.0.1:8080"

AJAX

Simple AJAX call to submit and recieve byte[] data

go run ajax.go

Visit *http://127.0.0.1:8080"

AJAX - JSON

Simple AJAX JSON request and response

go run ajax-json.go

Visit *http://127.0.0.1:8080"

AJAX - OCTET

Simple AJAX JSON Octet response

go run ajax-octet.go

Visit *http://127.0.0.1:8080"

Documentation

Overview

Client/Server AJAX JSON Communication using golang web-server and JQuery Visit: http://127.0.0.1:8080

Minimal Client/Server AJAX Communication using golang web-server and JQuery Visit: http://127.0.0.1:8080

Minimal Client/Server AJAX Communication using golang web-server and JQuery Visit: http://127.0.0.1:8080

Serving file using golang web-server Visit: http://127.0.0.1:8080

HTML form minimal example using golang web-server Visit: http://127.0.0.1:8080

Set header on golang web-server Try: curl -i localhost:8080

Miminal golang web-server JSON response Visit: http://127.0.0.1:8080

Miminal golang web-server implementation Visit: http://127.0.0.1:8080/Your-name

Nested templates using golang web-server Visit: http://127.0.0.1:8080

Redirect response using golang web-server Visit: http://127.0.0.1:8080/redirect

Parsing HTML from Template using golang web-server Visit: http://127.0.0.1:8080

Miminal golang web-server XML response Visit: http://127.0.0.1:8080

Jump to

Keyboard shortcuts

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