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
eaffabf3
authored
2013-08-21 22:47:58 +0800
by
fanngyuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add client
1 parent
0b74db64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
testing/client.go
testing/client.go
0 → 100644
View file @
eaffabf
package
testing
import
(
"github.com/fanngyuan/beego"
"github.com/fanngyuan/beego/httplib"
// "strings"
// "fmt"
)
var
port
=
""
var
baseUrl
=
"http://localhost:"
type
TestHttpRequest
struct
{
httplib
.
BeegoHttpRequest
}
func
getPort
()
string
{
if
port
==
""
{
config
,
err
:=
beego
.
LoadConfig
(
"../conf/app.conf"
)
if
err
!=
nil
{
return
"8080"
}
port
=
config
.
String
(
"httpport"
)
return
port
}
return
port
}
func
Get
(
path
string
)
*
TestHttpRequest
{
return
&
TestHttpRequest
{
*
httplib
.
Get
(
baseUrl
+
getPort
()
+
path
)}
}
func
Post
(
path
string
)
*
TestHttpRequest
{
return
&
TestHttpRequest
{
*
httplib
.
Post
(
baseUrl
+
getPort
()
+
path
)}
}
func
Put
(
path
string
)
*
TestHttpRequest
{
return
&
TestHttpRequest
{
*
httplib
.
Put
(
baseUrl
+
getPort
()
+
path
)}
}
func
Delete
(
path
string
)
*
TestHttpRequest
{
return
&
TestHttpRequest
{
*
httplib
.
Delete
(
baseUrl
+
getPort
()
+
path
)}
}
func
Head
(
path
string
)
*
TestHttpRequest
{
return
&
TestHttpRequest
{
*
httplib
.
Head
(
baseUrl
+
getPort
()
+
path
)}
}
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