github.com/sohaha/zlsgo@v1.7.13-0.20240501141223-10dd1a906f76/zhttp/requester.go (about)

     1  package zhttp
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  func DisableChunke(enable ...bool) {
     8  	std.DisableChunke(enable...)
     9  }
    10  
    11  func Get(url string, v ...interface{}) (*Res, error) {
    12  	return std.Get(url, v...)
    13  }
    14  
    15  func Post(url string, v ...interface{}) (*Res, error) {
    16  	return std.Post(url, v...)
    17  }
    18  
    19  func Put(url string, v ...interface{}) (*Res, error) {
    20  	return std.Put(url, v...)
    21  }
    22  
    23  func Head(url string, v ...interface{}) (*Res, error) {
    24  	return std.Head(url, v...)
    25  }
    26  
    27  func Options(url string, v ...interface{}) (*Res, error) {
    28  	return std.Options(url, v...)
    29  }
    30  
    31  func Delete(url string, v ...interface{}) (*Res, error) {
    32  	return std.Delete(url, v...)
    33  }
    34  
    35  func Patch(url string, v ...interface{}) (*Res, error) {
    36  	return std.Patch(url, v...)
    37  }
    38  
    39  func Connect(url string, v ...interface{}) (*Res, error) {
    40  	return std.Connect(url, v...)
    41  }
    42  
    43  func Trace(url string, v ...interface{}) (*Res, error) {
    44  	return std.Trace(url, v...)
    45  }
    46  
    47  func Do(method, rawurl string, v ...interface{}) (resp *Res, err error) {
    48  	return std.Do(method, rawurl, v...)
    49  }
    50  
    51  func DoRetry(attempt int, sleep time.Duration, fn func() (*Res, error)) (*Res, error) {
    52  	return std.DoRetry(attempt, sleep, fn)
    53  }