Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
c9ab84bc
Commit
c9ab84bc
authored
Dec 02, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup http client code
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
3ef0460b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
http/client.go
http/client.go
+7
-4
No files found.
http/client.go
View file @
c9ab84bc
...
...
@@ -79,10 +79,6 @@ func (c *client) Send(req cmds.Request) (cmds.Response, error) {
if
req
.
Files
()
!=
nil
{
fileReader
=
NewMultiFileReader
(
req
.
Files
(),
true
)
reader
=
fileReader
}
else
{
// if we have no file data, use an empty Reader
// (http.NewRequest panics when a nil Reader is used)
reader
=
strings
.
NewReader
(
""
)
}
path
:=
strings
.
Join
(
req
.
Path
(),
"/"
)
...
...
@@ -145,8 +141,15 @@ func (c *client) Send(req cmds.Request) (cmds.Response, error) {
}
func
getQuery
(
req
cmds
.
Request
)
(
string
,
error
)
{
// some options should be kept clientside, the server doesnt care
skip
:=
map
[
string
]
bool
{
"api"
:
true
,
}
query
:=
url
.
Values
{}
for
k
,
v
:=
range
req
.
Options
()
{
if
skip
[
k
]
{
continue
}
str
:=
fmt
.
Sprintf
(
"%v"
,
v
)
query
.
Set
(
k
,
str
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment