
上QQ阅读APP看书,第一时间看更新
RESTful server
If we have our RESTful server running on port 8000, we can open our web browser to http://localhost:8000/cars/1 and see the following:
{
"index": 1,
"car": "Honda Accord ES2"
}
This is a representation of an IndexedCar struct. It has an index and a car make and model string.
Here's the actual IndexedCar struct in types.go:
IndexedCar struct {
Index int `json:"index"`
Car string` json:"car"`
}