Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3fce78c7
authored
2013-11-28 13:52:24 +0800
by
Pengfei Xue
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
there is no need to check if b.params is nil
1 parent
a83a92cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
httplib/httplib.go
httplib/httplib.go
View file @
3fce78c
...
...
@@ -103,7 +103,7 @@ func (b *BeegoHttpRequest) Body(data interface{}) *BeegoHttpRequest {
func
(
b
*
BeegoHttpRequest
)
getResponse
()
(
*
http
.
Response
,
error
)
{
var
paramBody
string
if
b
.
params
!=
nil
&&
len
(
b
.
params
)
>
0
{
if
len
(
b
.
params
)
>
0
{
var
buf
bytes
.
Buffer
for
k
,
v
:=
range
b
.
params
{
buf
.
WriteString
(
url
.
QueryEscape
(
k
))
...
...
@@ -114,6 +114,7 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
paramBody
=
buf
.
String
()
paramBody
=
paramBody
[
0
:
len
(
paramBody
)
-
1
]
}
if
b
.
req
.
Method
==
"GET"
&&
len
(
paramBody
)
>
0
{
if
strings
.
Index
(
b
.
url
,
"?"
)
!=
-
1
{
b
.
url
+=
"&"
+
paramBody
...
...
@@ -130,10 +131,10 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
b
.
url
=
"http://"
+
b
.
url
url
,
err
=
url
.
Parse
(
b
.
url
)
}
if
err
!=
nil
{
return
nil
,
err
}
b
.
req
.
URL
=
url
if
b
.
showdebug
{
dump
,
err
:=
httputil
.
DumpRequest
(
b
.
req
,
true
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment