This commit is contained in:
Michael Quigley 2024-01-03 17:05:18 -05:00
parent 0c39cd8752
commit ef0ac1e140
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -6,10 +6,27 @@ type Client struct {
client *http.Client
}
func NewHttpClient(uri string) *Client {
func NewHttpClient() *Client {
return &Client{&http.Client{}}
}
func (c *Client) Connect() error {
return nil
}
func (c *Client) options(uri string) (*http.Response, error) {
return c.request("OPTIONS", uri)
}
func (c *Client) request(method, uri string) (resp *http.Response, err error) {
req, err := http.NewRequest(method, uri, nil)
if err != nil {
return nil, err
}
if resp, err = c.client.Do(req); err != nil {
return resp, err
}
return resp, err
}