From 8006140dd4b64cf103f72981bc2322db3dc332c0 Mon Sep 17 00:00:00 2001 From: Sunil Joshi <4852488+c0dehu1k@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:11:29 +0530 Subject: [PATCH] Added http-server /headers example --- examples/http-server/http-server.sh | 6 ++++++ public/http-server | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/examples/http-server/http-server.sh b/examples/http-server/http-server.sh index 2db5f45..d85df9b 100644 --- a/examples/http-server/http-server.sh +++ b/examples/http-server/http-server.sh @@ -4,3 +4,9 @@ $ go run http-servers.go & # Access the `/hello` route. $ curl localhost:8090/hello hello + + +# Access the `/headers` route. +$ curl localhost:8090/headers +Accept: */* +User-Agent: curl/8.1.2 diff --git a/public/http-server b/public/http-server index e2ecdc6..0f7d04e 100644 --- a/public/http-server +++ b/public/http-server @@ -168,13 +168,26 @@ router we’ve just set up.
Access the /hello
route.
$ curl localhost:8090/hello
hello
Access the /headers
route.
$ curl localhost:8090/headers
+Accept: */*
+User-Agent: curl/8.1.2
+