Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Go Httpbin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Nix
Go Httpbin
Commits
d61e3d32
Commit
d61e3d32
authored
8 years ago
by
Will McCutchen
Browse files
Options
Downloads
Patches
Plain Diff
Distinguish query params from request body params
parent
615ed601
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.go
+6
-2
6 additions, 2 deletions
main.go
with
6 additions
and
2 deletions
main.go
+
6
−
2
View file @
d61e3d32
...
@@ -58,9 +58,13 @@ func formsPost(w http.ResponseWriter, r *http.Request, t *template.Template) {
...
@@ -58,9 +58,13 @@ func formsPost(w http.ResponseWriter, r *http.Request, t *template.Template) {
}
}
func
get
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
func
get
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
r
.
ParseForm
()
args
,
err
:=
url
.
ParseQuery
(
r
.
URL
.
RawQuery
)
if
err
!=
nil
{
http
.
Error
(
w
,
fmt
.
Sprintf
(
"error parsing query params: %s"
,
err
),
http
.
StatusBadRequest
)
return
}
resp
:=
&
Resp
{
resp
:=
&
Resp
{
Args
:
r
.
Form
,
Args
:
args
,
Headers
:
r
.
Header
,
Headers
:
r
.
Header
,
}
}
writeResponse
(
w
,
r
,
resp
)
writeResponse
(
w
,
r
,
resp
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment