Optional
_apiUrl: stringProtected
_apiProtected
_honeycombGetter for the apiUrl
property.
Provides access to the base API URL used to make HTTP requests.
Setter for the apiUrl
property.
Sets the base API URL used to make HTTP requests.
The new API URL to set.
Getter for the authToken
property.
Provides access to the authentication token used in HTTP requests.
Setter for the authToken
property.
Sets the authentication token used in HTTP requests.
The new authentication token to set.
Getter for the headers
property.
Provides access to the headers used in HTTP requests.
Setter for the headers
property.
Sets the headers used in HTTP requests.
The new headers to set.
Method to make a DELETE request using the request method.
The API endpoint to make the DELETE request to.
Optional
opts: HttpRequestOptionsThe options for the DELETE request.
A Promise that resolves to the response data.
// Example for making a DELETE request with default API URL
honeycomb.http().delete('/user')
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
// Example for making a DELETE request with custom URL
honeycomb.http().delete('https://example.com/api/user')
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Makes a GET request to the specified endpoint using the default API URL.
The endpoint URL to make the request to.
Optional
opts: HttpRequestOptionsAdditional options for the request.
A Promise that resolves to the response data.
// Example for making a GET request with default API URL
honeycomb.http().get('/users', { authToken: 'myAuthToken' })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
// Example for making a GET request with custom URL
honeycomb.http().get('https://example.com/api/users', { authToken: 'myAuthToken' })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Method to make a POST request using the request method.
The API endpoint to make the POST request to.
Optional
opts: HttpRequestOptionsThe options for the POST request.
A Promise that resolves to the response data.
// Example for making a POST request with default API URL
honeycomb.http().post('/user', { data: {...} })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
// Example for making a POST request with custom URL
honeycomb.http().post('https://example.com/api/user', { data: {...} })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Method to make a PUT request using the request method.
The API endpoint to make the PUT request to.
Optional
opts: HttpRequestOptionsThe options for the PUT request.
A Promise that resolves to the response data.
// Example for making a PUT request with default API URL
honeycomb.http().put('/user', { data: {...} })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
// Example for making a PUT request with custom URL
honeycomb.http().put('https://example.com/api/user', { data: {...} })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Method to make a generic HTTP request using either Axios or Fetch.
The API endpoint to make the request to.
Optional
opts: HttpRequestOptionsFullThe options for the HTTP request.
A Promise that resolves to the response data.
// Example for making a request with default api url
honeycomb.http().request('/users', { method: "GET" })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
// Example for making a request with default api url
honeycomb.http().request('https://example.com/api/users', { method: "GET" })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Generated using TypeDoc
HttpClient class that extends the HttpModule. Provides methods for making HTTP requests using Axios or Fetch.