mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 21:49:52 +00:00
20 lines
451 B
Go
20 lines
451 B
Go
package cacheflysdk
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
func (c *Client) CreateCertificate(req *CreateCertificateRequest) (*CreateCertificateResponse, error) {
|
|
params := make(map[string]any)
|
|
jsonData, _ := json.Marshal(req)
|
|
json.Unmarshal(jsonData, ¶ms)
|
|
|
|
result := CreateCertificateResponse{}
|
|
err := c.sendRequestWithResult(http.MethodPost, "/certificates", params, &result)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &result, nil
|
|
}
|