Documentation
¶
Overview ¶
*************************************************************************** MIT License
Copyright (c) 2022 yjhi ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************
*************************************************************************** MIT License
Copyright (c) 2022 yjhi ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************
*************************************************************************** MIT License
Copyright (c) 2022 yjhi ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************
*************************************************************************** MIT License
Copyright (c) 2022 yjhi ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************
*************************************************************************** MIT License
Copyright (c) 2022 yjhi ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************
Index ¶
- func DownFile(url string, fname string, fpath string) error
- func Get(url string) (string, error)
- func HttpGet(url string, seconds int) (string, int, error)
- func HttpPost(url string, seconds int, contentType string, data string) (string, int, error)
- func HttpPostJson(url string, seconds int, data string) (string, int, error)
- func Post(url string, t string, d string) (string, error)
- func PostJson(url string, d string) (string, error)
- func SaveFile(file *multipart.FileHeader, path string, name string) (string, error)
- func UploadFile(url string, timeout int32, filePath string) (string, error)
- func UploadFileWithName(url string, timeout int32, filePath string, name string) (string, error)
- func UploadFiles(url string, timeout int32, files []string, name string) (string, error)
- func WebService11(url string, body string) (string, error)
- func WebService12(url string, body string) (string, error)
- type Http
- func Create(url string, timeoutSecond int, way string) *Http
- func CreateGET(url string, timeoutSecond int) *Http
- func CreatePOST(url string, timeoutSecond int) *Http
- func CreatePOSTWithData(url string, timeoutSecond int, data string) *Http
- func CreatePUT(url string, timeoutSecond int) *Http
- func CreateWithData(url string, timeoutSecond int, way string, data string) *Http
- func New(url string, timeoutSecond int, way string) *Http
- func NewWithData(url string, timeoutSecond int, way string, data string) *Http
- func (h *Http) AddCookie(name string, value string, path string, domain string) *Http
- func (h *Http) AddHeader(name string, value string) *Http
- func (h *Http) HttpError() (bool, error)
- func (h *Http) Send() (string, int, error)
- func (h *Http) SendRequest() (string, error)
- func (h *Http) SendRequestWithBody() (string, int, error)
- func (h *Http) SendRequestWithResp() (*HttpResp, error)
- func (h *Http) SendRequestWithoutBody() (int, error)
- func (h *Http) SetHeader(name string, value string) *Http
- func (h *Http) WithAccept(v string) *Http
- func (h *Http) WithContentType(v string) *Http
- func (h *Http) WithHeader(name string, value string) *Http
- func (h *Http) WithJsonContentType() *Http
- func (h *Http) WithUserAgent(v string) *Http
- func (h *Http) WithUserAgentDefault() *Http
- type HttpResp
- type HttpUA
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpPost ¶
func SaveFile ¶
保存文件
func UploadFile ¶
upload file to server,name is files
func UploadFileWithName ¶
upload file to server
func UploadFiles ¶
upload files to url
func WebService11 ¶
/send a request of webservice /version 1.1
Types ¶
type Http ¶
type Http struct { Client *http.Client Error string Request *http.Request // contains filtered or unexported fields }
/Add By yjh 2021-06-17
func CreateWithData ¶
func (*Http) AddCookie ¶
type HttpResp ¶
/Add By yjh 2021-06-17