Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
738e22e3
Commit
738e22e3
authored
Apr 25, 2015
by
JessonChan
Committed by
astaxie
May 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zero timeout means wait until resp
parent
69fc22f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
httplib.go
httplib/httplib.go
+3
-9
No files found.
httplib/httplib.go
View file @
738e22e3
...
...
@@ -65,14 +65,8 @@ func createDefaultCookie() {
// Overwrite default settings
func
SetDefaultSetting
(
setting
BeegoHttpSettings
)
{
settingMutex
.
Lock
()
defer
settingMutex
.
Unlock
()
defaultSetting
=
setting
if
defaultSetting
.
ConnectTimeout
==
0
{
defaultSetting
.
ConnectTimeout
=
60
*
time
.
Second
}
if
defaultSetting
.
ReadWriteTimeout
==
0
{
defaultSetting
.
ReadWriteTimeout
=
60
*
time
.
Second
}
settingMutex
.
Unlock
()
}
// return *BeegoHttpRequest with specific method
...
...
@@ -262,11 +256,11 @@ func (b *BeegoHttpRequest) PostFile(formname, filename string) *BeegoHttpRequest
// it supports string and []byte.
func
(
b
*
BeegoHttpRequest
)
Body
(
data
interface
{})
*
BeegoHttpRequest
{
switch
t
:=
data
.
(
type
)
{
case
string
:
case
string
:
bf
:=
bytes
.
NewBufferString
(
t
)
b
.
req
.
Body
=
ioutil
.
NopCloser
(
bf
)
b
.
req
.
ContentLength
=
int64
(
len
(
t
))
case
[]
byte
:
case
[]
byte
:
bf
:=
bytes
.
NewBuffer
(
t
)
b
.
req
.
Body
=
ioutil
.
NopCloser
(
bf
)
b
.
req
.
ContentLength
=
int64
(
len
(
t
))
...
...
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