func (whs WebhookSender) SendAndReadResponse(ctx context.Context, message Message) (*PostMessageResponse, error) {
	res, err := whs.send(ctx, message)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()

	var contents PostMessageResponse
	err = json.NewDecoder(res.Body).Decode(&contents)
	if err != nil {
		return nil, ex.New(err)
	}
	if statusCode := res.StatusCode; statusCode < http.StatusOK || statusCode > 299 {
		return &contents, ex.New(ErrNon200, ex.OptMessagef("%#v", contents))
	}
	return &contents, nil
}
// SendAndReadResponse sends a slack hook and returns the deserialized response
SendAndReadResponse sends a slack hook and returns the deserialized response
// SendAndReadResponse sends a slack hook and returns the deserialized response
func (whs WebhookSender) SendAndReadResponse(ctx context.Context, message Message) (*PostMessageResponse, error) {
	res, err := whs.send(ctx, message)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()
	var contents PostMessageResponse
	err = json.NewDecoder(res.Body).Decode(&contents)
	if err != nil {
		return nil, ex.New(err)
	}
	if statusCode := res.StatusCode; statusCode < http.StatusOK || statusCode > 299 {
		return &contents, ex.New(ErrNon200, ex.OptMessagef("%#v", contents))
	}
	return &contents, nil
}
func ( whs WebhookSender ) SendAndReadResponse ( ctx context . Context , message Message ) ( * PostMessageResponse , error ) { res , err := whs . send ( ctx , message ) if err != nil { return nil , err } defer res . Body . Close ( ) var contents PostMessageResponse err = json . NewDecoder ( res . Body ) . Decode ( & contents ) if err != nil { return nil , ex . New ( err ) } if statusCode := res . StatusCode ; statusCode < http . StatusOK || statusCode > 299 { return & contents , ex . New ( ErrNon200 , ex . OptMessagef ( " " , contents ) ) } return & contents , nil }
SendAndReadResponse sends a slack hook and returns the deserialized response
SendAndReadResponse sends a slack hook and returns the deserialized response