// GetAuthorization retrieves an authorization identified by the given URL.
//
// If a caller needs to poll an authorization until its status is final,
// see the WaitAuthorization method.
GetAuthorization retrieves an authorization identified by the given URL.

If a caller needs to poll an authorization until its status is final,
see the WaitAuthorization method.
// GetAuthorization retrieves an authorization identified by the given URL . // // If a caller needs to poll an authorization until its status is final // see the WaitAuthorization method .
func (c *Client) GetAuthorization(ctx context.Context, url string) (*Authorization, 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)
	}
	var v wireAuthz
	if err := json.NewDecoder(res.Body).Decode(&v); err != nil {
		return nil, fmt.Errorf("acme: invalid response: %v", err)
	}
	return v.authorization(url), nil
}
func ( c * Client ) GetAuthorization ( ctx context . Context , url string ) ( * Authorization , 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 ) } var v wireAuthz if err := json . NewDecoder ( res . Body ) . Decode ( & v ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } return v . authorization ( url ) , nil }
GetAuthorization retrieves an authorization identified by the given URL.
GetAuthorization retrieves an authorization identified by the given URL .