Statische Rückgabe
package main
import (
"net/http"
_ "net/http/pprof"
)
type Result struct {
Name string
}
var bites = []byte("{}")
func myHandler(writer http.ResponseWriter, req *http.Request) {
writer.Header().Add("Content-Type", "application/json")
writer.Write(bites)
}
func main() {
http.HandleFunc("/", myHandler)
http.ListenAndServe(":8080", nil)
}
| Server Software: |
|
| Server Hostname: |
localhost |
| Server Port: |
8080 |
| Document Path: |
/Kristian |
| Document Length: |
2 bytes |
| Concurrency Level: |
3 |
| Time taken for tests: |
0.401 seconds |
| Complete requests: |
10000 |
| Failed requests: |
0 |
| Total transferred: |
1090000 bytes |
| HTML transferred: |
20000 bytes |
| Requests per second: |
24916.72 |
| Transfer rate: |
2652.27 kb/s received |
| Connnection Times (ms) |
| |
min |
avg |
max |
| Connect: |
0 |
0 |
1 |
| Processing: |
0 |
0 |
0 |
| Total: |
0 |
0 |
1 |