2017-03-13 20:45:27 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
func handler(w http.ResponseWriter, r *http.Request) {
|
2017-04-02 14:07:07 +00:00
|
|
|
fmt.Fprintf(w, "UserID: %s, UserRole: %s", r.Header.Get("UserID"), r.Header.Get("UserRole"))
|
|
|
|
}
|
2017-03-13 20:45:27 +00:00
|
|
|
|
|
|
|
// Sample "echo" service displaying UserID and UserRole HTTP request headers
|
|
|
|
func main() {
|
|
|
|
http.HandleFunc("/", handler)
|
|
|
|
http.ListenAndServe(":8080", nil)
|
|
|
|
}
|