func (runner *APIRunner) DoAPIRequest(req *ApiRequest) (*http.Response, error) {

	runner.output.EchoStartRequest(req, runner)

	httpReq, err := CreateHttpRequest(req, runner)
	if err != nil {
		return nil, err
	}

	runner.output.Headers(httpReq.Header)
	runner.output.RequestBody(httpReq, runner)
	res, err := runner.client.Do(httpReq)
	if err != nil {
		return nil, err
	}

	runner.output.Echo("\nResponse ")
	if res.StatusCode == 200 {
		color.Green("Status: %d\n\n", res.StatusCode)
	} else {
		color.Red("Status: %d\n\n", res.StatusCode)
	}
	runner.output.Headers(res.Header)
	return res, nil
}
// DoAPIRequest run the api request
DoAPIRequest run the api request
// DoAPIRequest run the api request
func (runner *APIRunner) DoAPIRequest(req *ApiRequest) (*http.Response, error) {
	runner.output.EchoStartRequest(req, runner)
	httpReq, err := CreateHttpRequest(req, runner)
	if err != nil {
		return nil, err
	}
	runner.output.Headers(httpReq.Header)
	runner.output.RequestBody(httpReq, runner)
	res, err := runner.client.Do(httpReq)
	if err != nil {
		return nil, err
	}
	runner.output.Echo("\nResponse ")
	if res.StatusCode == 200 {
		color.Green("Status: %d\n\n", res.StatusCode)
	} else {
		color.Red("Status: %d\n\n", res.StatusCode)
	}
	runner.output.Headers(res.Header)
	return res, nil
}
func ( runner * APIRunner ) DoAPIRequest ( req * ApiRequest ) ( * http . Response , error ) { runner . output . EchoStartRequest ( req , runner ) httpReq , err := CreateHttpRequest ( req , runner ) if err != nil { return nil , err } runner . output . Headers ( httpReq . Header ) runner . output . RequestBody ( httpReq , runner ) res , err := runner . client . Do ( httpReq ) if err != nil { return nil , err } runner . output . Echo ( " \n " ) if res . StatusCode == 200 { color . Green ( " \n \n " , res . StatusCode ) } else { color . Red ( " \n \n " , res . StatusCode ) } runner . output . Headers ( res . Header ) return res , nil }
DoAPIRequest run the api request
DoAPIRequest run the api request