File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -46,16 +46,20 @@ func NewRequest(options ...Option) *Request {
4646 return request
4747}
4848
49- func Init (method string ) * Request {
50- return NewRequest ().ContentType ("form" ).Method (method )
51- }
52-
5349func Post (uri string , payload interface {}) * Request {
54- return Init ( POST ). Uri (uri ). Body ( payload )
50+ return NewRequest (). Post (uri , payload )
5551}
5652
5753func Get (uri string , payload interface {}) * Request {
58- return Init (GET ).Uri (uri ).Body (payload )
54+ return NewRequest ().Get (uri , payload )
55+ }
56+
57+ func (r * Request ) Post (uri string , payload interface {}) * Request {
58+ return r .ContentType (FORM ).Method (POST ).Uri (uri ).Body (payload )
59+ }
60+
61+ func (r * Request ) Get (uri string , payload interface {}) * Request {
62+ return r .ContentType (FORM ).Method (GET ).Uri (uri ).Body (payload )
5963}
6064
6165func (r * Request ) Send () (* Response , error ) {
You can’t perform that action at this time.
0 commit comments