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
35b4022e
authored
2014-08-22 17:03:56 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
httplib: set the default proto
1 parent
77294a58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
httplib/httplib.go
httplib/httplib.go
View file @
35b4022
...
...
@@ -79,6 +79,9 @@ func Get(url string) *BeegoHttpRequest {
var
resp
http
.
Response
req
.
Method
=
"GET"
req
.
Header
=
http
.
Header
{}
req
.
Proto
=
"HTTP/1.1"
req
.
ProtoMajor
=
1
req
.
ProtoMinor
=
1
return
&
BeegoHttpRequest
{
url
,
&
req
,
map
[
string
]
string
{},
map
[
string
]
string
{},
defaultSetting
,
&
resp
,
nil
}
}
...
...
@@ -88,6 +91,9 @@ func Post(url string) *BeegoHttpRequest {
var
resp
http
.
Response
req
.
Method
=
"POST"
req
.
Header
=
http
.
Header
{}
req
.
Proto
=
"HTTP/1.1"
req
.
ProtoMajor
=
1
req
.
ProtoMinor
=
1
return
&
BeegoHttpRequest
{
url
,
&
req
,
map
[
string
]
string
{},
map
[
string
]
string
{},
defaultSetting
,
&
resp
,
nil
}
}
...
...
@@ -97,6 +103,9 @@ func Put(url string) *BeegoHttpRequest {
var
resp
http
.
Response
req
.
Method
=
"PUT"
req
.
Header
=
http
.
Header
{}
req
.
Proto
=
"HTTP/1.1"
req
.
ProtoMajor
=
1
req
.
ProtoMinor
=
1
return
&
BeegoHttpRequest
{
url
,
&
req
,
map
[
string
]
string
{},
map
[
string
]
string
{},
defaultSetting
,
&
resp
,
nil
}
}
...
...
@@ -106,6 +115,9 @@ func Delete(url string) *BeegoHttpRequest {
var
resp
http
.
Response
req
.
Method
=
"DELETE"
req
.
Header
=
http
.
Header
{}
req
.
Proto
=
"HTTP/1.1"
req
.
ProtoMajor
=
1
req
.
ProtoMinor
=
1
return
&
BeegoHttpRequest
{
url
,
&
req
,
map
[
string
]
string
{},
map
[
string
]
string
{},
defaultSetting
,
&
resp
,
nil
}
}
...
...
@@ -115,6 +127,9 @@ func Head(url string) *BeegoHttpRequest {
var
resp
http
.
Response
req
.
Method
=
"HEAD"
req
.
Header
=
http
.
Header
{}
req
.
Proto
=
"HTTP/1.1"
req
.
ProtoMajor
=
1
req
.
ProtoMinor
=
1
return
&
BeegoHttpRequest
{
url
,
&
req
,
map
[
string
]
string
{},
map
[
string
]
string
{},
defaultSetting
,
&
resp
,
nil
}
}
...
...
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