// GetChallenge retrieves the current status of an challenge.
//
// A client typically polls a challenge status using this method.
GetChallenge retrieves the current status of an challenge.

A client typically polls a challenge status using this method.
// GetChallenge retrieves the current status of an challenge . // // A client typically polls a challenge status using this method .
func (c *Client) GetChallenge(ctx context.Context, url string) (*Challenge, error) {
	res, err := c.get(ctx, url)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()
	if res.StatusCode != http.StatusOK && res.StatusCode != http.StatusAccepted {
		return nil, responseError(res)
	}
	v := wireChallenge{URI: url}
	if err := json.NewDecoder(res.Body).Decode(&v); err != nil {
		return nil, fmt.Errorf("acme: invalid response: %v", err)
	}
	return v.challenge(), nil
}
func ( c * Client ) GetChallenge ( ctx context . Context , url string ) ( * Challenge , error ) { res , err := c . get ( ctx , url ) if err != nil { return nil , err } defer res . Body . Close ( ) if res . StatusCode != http . StatusOK && res . StatusCode != http . StatusAccepted { return nil , responseError ( res ) } v := wireChallenge { URI : url } if err := json . NewDecoder ( res . Body ) . Decode ( & v ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } return v . challenge ( ) , nil }
GetChallenge retrieves the current status of an challenge.
GetChallenge retrieves the current status of an challenge .