Update 15.2.md

complete 15.2
This commit is contained in:
glight2000
2015-12-10 23:23:57 +08:00
parent d779d1fe22
commit 6a419a7024

View File

@@ -93,19 +93,15 @@ func (obj *Typ) ServeHTTP(w http.ResponseWriter, req *http.Request) {
练习 15.2[webhello2.go](exercises/chapter_15/webhello2.go)
>编写一个网页服务器监听端口9999有如下处理函数
编写一个网页服务器监听端口9999有如下处理函数
>i)当请求`http://localhost:9999/hello/Name`时,响应:`hello Name`(Name需是一个合法的姓比如Chris或者Madeleine)
* 当请求`http://localhost:9999/hello/Name`时,响应:`hello Name`(Name需是一个合法的姓比如Chris或者Madeleine)
>ii)当请求`http://localhost:9999/shouthello/Name`时,响应:`hello NAME`
* 当请求`http://localhost:9999/shouthello/Name`时,响应:`hello NAME`
练习 15.3[hello_server.go](exercises/chapter_15/hello_server.go)
>
创建一个空结构`hello`并使它实现`http.Handler`。运行并测试。
## 链接