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
69da9b6d
Commit
69da9b6d
authored
Nov 03, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands/http: Cleaner URL formation in client
parent
e4b7bf7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
http/client.go
http/client.go
+6
-3
No files found.
http/client.go
View file @
69da9b6d
...
...
@@ -11,7 +11,10 @@ import (
cmds
"github.com/jbenet/go-ipfs/commands"
)
const
ApiPath
=
"/api/v0"
// TODO: make configurable
const
(
ApiUrlFormat
=
"http://%s%s/%s"
ApiPath
=
"/api/v0"
// TODO: make configurable
)
// Client is the commands HTTP client interface.
type
Client
interface
{
...
...
@@ -27,8 +30,8 @@ func NewClient(address string) Client {
}
func
(
c
*
client
)
Send
(
req
cmds
.
Request
)
(
cmds
.
Response
,
error
)
{
url
:=
"http://"
+
c
.
serverAddress
+
ApiPath
url
+
=
"/"
+
strings
.
Join
(
req
.
Path
(),
"/"
)
path
:=
strings
.
Join
(
req
.
Path
(),
"/"
)
url
:
=
fmt
.
Sprintf
(
ApiUrlFormat
,
c
.
serverAddress
,
ApiPath
,
path
)
var
userEncoding
string
if
enc
,
found
:=
req
.
Option
(
cmds
.
EncShort
);
found
{
...
...
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