Sends a DELETE request to remove data from the server
Promise resolving to the response data. Type depends on responseType
HttpResponseError when the server responds with an error status (4xx, 5xx)
const http = platform.get(PlatformServiceName.Http);
await http.delete('my_addon/users/123');
Relative URL to the resource (e.g., 'my_addon/users/123')
Optional options: HttpOptionsOptional HttpOptions for query parameters or headers
Sends a GET request to retrieve data from the server
Promise resolving to the response data. Type depends on responseType
HttpResponseError when the server responds with an error status (4xx, 5xx)
const http = platform.get(PlatformServiceName.Http);
const users = await http.get('my_addon/users', {
params: { active: 'true', limit: '10' }
});
Relative URL to the resource (e.g., 'my_addon/endpoint'). The URL is relative to the Lime CRM base URL.
Optional options: HttpOptionsOptional HttpOptions for query parameters, headers, or response type
Sends a PATCH request to partially update existing data on the server
Promise resolving to the response data. Type depends on responseType
HttpResponseError when the server responds with an error status (4xx, 5xx)
const http = platform.get(PlatformServiceName.Http);
await http.patch('my_addon/users/123', {
email: 'newemail@example.com'
});
Relative URL to the resource (e.g., 'my_addon/users/123')
Optional data: objectPartial payload containing only the fields to update
Optional options: HttpOptionsOptional HttpOptions for query parameters, headers, or response type
Sends a POST request to create new data on the server
Promise resolving to the response data. Type depends on responseType
HttpResponseError when the server responds with an error status (4xx, 5xx)
const http = platform.get(PlatformServiceName.Http);
const newUser = await http.post('my_addon/users', {
name: 'Jane Smith',
email: 'jane@example.com'
});
Relative URL to the resource (e.g., 'my_addon/endpoint')
Optional data: objectPayload to send in the request body. Will be JSON-encoded by default.
Optional options: HttpOptionsOptional HttpOptions for query parameters, headers, or response type
Sends a PUT request to replace existing data on the server
Promise resolving to the response data. Type depends on responseType
HttpResponseError when the server responds with an error status (4xx, 5xx)
const http = platform.get(PlatformServiceName.Http);
await http.put('my_addon/users/123', {
name: 'Jane Doe',
email: 'jane@example.com',
role: 'admin'
});
Relative URL to the resource (e.g., 'my_addon/users/123')
Optional data: objectComplete payload to replace the existing resource
Optional options: HttpOptionsOptional HttpOptions for query parameters, headers, or response type
HTTP service for sending requests to backend endpoints
The HttpClient is the primary interface for making HTTP requests within the Lime platform.
By default, all requests expect JSON responses. For other content types (text, binary data, etc.), set the
responseTypein HttpOptions.All methods throw HttpResponseError on HTTP errors (4xx, 5xx status codes).
Example
Basic GET request for JSON data
Example
POST request with data and query parameters
Example
Error handling with HttpResponseError
Example
Downloading a file as blob