You can learn about using hertz client to send request:
- Do():
Do()sends the request and writes the response to theresp. This function does not support redirect jumps, if you want to use it, please useDoRedirectsorGet*methods. - DoDeadline():
DoDeadline()sends the request and writes the response to theresp, and returns an error if there is no response after the given deadline. This method does not support redirect jumps, if you want to use it, please useDoRedirectsorGet*methods. - DoRedirects():
DoRedirectssupport redirect, when the number of redirects exceeds maxRedirectsCount will return error. - DoTimeout():
DoTimeout()sends the request and writes the response to theresp. If there is no response after the given timeout, a timeout error is returned. This method does not support redirect jumps, if you want to use it, please useDoRedirectsorGet*methods. - Get():
Get()will return the corresponding status code and response body according to the url;dstwill be replaced with the response request body, ifdstis too small a new slice will be assigned. This method supports redirect. - GetDeadline():
GetDeadline()will return the corresponding status code and response body according to the url; if no response after the given deadline will return a timeout error,dstwill be replaced with the response request body, and ifdstis too small a new slice will be assigned. This method supports redirect. - GetTimeout():
GetTimeout()will return the corresponding status code and response body according to the url; if there is no response after a given timeout, it will return an error,dstwill be replaced with the response request body, and ifdstis too small a new slice will be assigned. This method supports redirect. - Post():
Post()will send a post request based on the url and post parameters,dstwill be replaced with a response request body, ifdstis too small a new slice will be assigned. The method supports redirect jumps. And the content-type used is application/x-www-url-form