// ok sets status to 200 and puts "OK" in response.
2369
func (c *requestContext) ok() {
	c.Writer.Header().Set("Content-Type", "text/plain; charset=utf-8")
	c.Writer.WriteHeader(200)
	fmt.Fprintln(c.Writer, "OK")
}
172876
func (r *Request) Do() *Response {
	if r.err != nil {
		return &Response{
			err: r.err,
		}
	}

	req, err := r.request()
	if err != nil {
		return &Response{
			err: err,
		}
	}

	res, err := r.client.Do(req)
	if err != nil {
		return &Response{
			err: err,
		}
	}

	// return res, err
	return newResponse(res, err)
}
729253
func (hc *Check) Status() Status {
	hc.lock.RLock()
	defer hc.lock.RUnlock()
	status := Status{
		LastCheck: hc.start,
		Failures:  hc.failures,
		Successes: hc.successes,
		State:     hc.state,
	}
	if hc.result != nil {
		status.Duration = hc.result.Duration
		status.Message = hc.result.String()
	}
	return status
}
1314532
func (rp *Reply) OKValue() error {
	if rp.Type == ErrorReply {
		return errors.New(rp.Error)
	}
	if rp.Type != StatusReply {
		return errors.New("invalid reply type, not status")
	}
	if rp.Status == "OK" {
		return nil
	}
	return errors.New(rp.Status)
}
1134928
func Status(codes ...int) *Mux {
	return Match(func(ctx *c.Context) bool {
		if ctx.GetString("$phase") != "response" {
			return false
		}
		for _, code := range codes {
			if ctx.Response.StatusCode == code {
				return true
			}
		}
		return false
	})
}
1236827
func Health(resp http.ResponseWriter, req *http.Request) {
	fmt.Fprintf(resp, "OK")
}
1217106
func (o *oracleInstance) Status(ctx context.ProviderCallContext) instance.Status {
	return o.status
}
503290
func (k *Kongo) checkResponse(res *http.Response) error {
	if c := res.StatusCode; c >= 200 && c <= 299 {
		return nil
	}

	errorResponse := &ErrorResponse{Response: res}

	data, err := ioutil.ReadAll(res.Body)

	if err != nil {
		return errorResponse
	}

	if len(data) == 0 {
		return errorResponse
	}

	err = json.Unmarshal(data, errorResponse)

	if err != nil {
		errorResponse.Message = string(data)
	}

	return errorResponse
}
1160453
func CheckResponse(r *http.Response) error {
	if c := r.StatusCode; 200 <= c && c <= 299 {
		return nil
	}
	errorResponse := &ErrorResponse{Response: r}
	data, err := ioutil.ReadAll(r.Body)
	if err == nil && data != nil {
		json.Unmarshal(data, errorResponse)
	}
	return errorResponse
}
1309101
func (r *ReachableChecker) Status() (interface{}, error) {
	// We must provide a port so when a port is not set in the URL provided use
	// the default port (80)
	port := r.url.Port()
	if len(port) == 0 {
		port = ReachableDefaultPort
	}

	conn, err := r.dialer(r.network, r.url.Hostname()+":"+port, r.timeout)
	if err != nil {
		return r.fail(err)
	}
	if conn != nil {
		if errClose := conn.Close(); errClose != nil {
			return r.fail(errClose)
		}
	}
	return nil, nil
}
216152
func (resp *Response) Fail(msg ...interface{}) *Response {
	resp.assertion.True(resp.resp.StatusCode >= 400, msg...)

	return resp
}
80498
func (ctx *Context) OkJSON(val interface{}) error {
	return ctx.JSON(http.StatusOK, val)
}
1027205
func (c *SCSICmd) Ok() SCSIResponse {
	return SCSIResponse{
		id:     c.id,
		status: scsi.SamStatGood,
	}
}
1294274
func (r *ResponseMatcher) Status(code int) *ResponseMatcher {
	r.mux.mu.Lock()
	defer r.mux.mu.Unlock()
	r.minStatus = code
	r.maxStatus = code
	return r
}
511316
func (c *Client) Status() (*status.Status, error) {
	type statusResponse struct {
		Data status.Status `json:"data"`
	}
	s := &statusResponse{}
	if err := c.Get(status.Path, s); err != nil {
		return nil, err
	}
	return &s.Data, nil
}
893873
func (r Request) Do() (Response, error) {
	client := &http.Client{}
	client.Timeout = r.Timeout
	res, err := client.Do(r.Req)
	return Response{res, r.URI}, err
}
232617
func (ctx *ShowBottleContext) OK(r *Bottle) error {
	if ctx.ResponseData.Header().Get("Content-Type") == "" {
		ctx.ResponseData.Header().Set("Content-Type", "application/vnd.bottle+json")
	}
	return ctx.ResponseData.Service.Send(ctx.Context, 200, r)
}