go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

I hope that httpc can use the api format to parse the return value according to the returned structure definition.

Open sdhczw opened this issue 1 year ago • 1 comments

we use the repeated code to parser the response, can gozero use the api format to parse the return value according to the returned structure definition?

	if http.StatusOK != httpRsp.StatusCode {
		return nil, fmt.Errorf("http staus code: %d", httpRsp.StatusCode)
	}
	rspData, err := ioutil.ReadAll(httpRsp.Body)
	var bodyRsp Response
	err = jsonx.Unmarshal(rspData, &bodyRsp)

sdhczw avatar Jul 11 '22 08:07 sdhczw

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Aug 11 '22 02:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Nov 09 '22 02:11 github-actions[bot]