Request Configuration
API Check Request Configuration
What is Request Configuration?
The Request Configuration is where you define the details of the API endpoint you want to test. This includes setting the URL, HTTP method, and any additional parameters or headers required for the request.
Configuring the Request
- URL Endpoint: Set the URL of the API endpoint you want to test. This is the address that the check will send requests to.
- HTTP Methods: Choose from the following allowed HTTP methods based on what your API endpoint supports:
- GET: Retrieve data from the server.
- POST: Send data to the server to create/update a resource.
- PUT: Update an existing resource on the server.
- PATCH: Partially update an existing resource on the server.
- DELETE: Remove a resource from the server.
Additional Request Configurations
You can further customize your API Check with the following options:
Query Parameters (the Params tab, Add Query Parameter): Add key/value pairs to pass additional data through the URL. The URL box and the list stay in sync: a pair you add shows up in the URL, and a parameter you type into the URL shows up in the list.
Headers (the Headers tab, Add Header): Add custom headers to your request. Headers can be used to send metadata and control how the request is processed.
POST Body (the Body tab): Choose a body type (none, JSON, form-data, GraphQL or raw) and enter the body. This is useful for sending data to create or update resources.
Basic Authentication (the Authentication tab, Configure Basic Authentication): Enter a username and password. This is used to authenticate the request with the server.
Skip SSL (the Settings tab): Option to skip SSL verification. This can be useful for testing endpoints with self-signed certificates.
Follow redirects (the Settings tab): Option to follow HTTP redirects. This ensures that the check follows any redirection responses from the server.
Import from cURL
Instead of filling in the request by hand, paste a cURL command. Click Import from cURL, just below the URL box, paste the command (for example one copied from your browser's developer tools with "Copy as cURL", or from your API documentation) and click Import. LoadFocus fills in the URL, the HTTP method, query parameters, headers, the body (JSON, URL-encoded or raw, with its Content-Type header) and basic authentication from -u, and switches on Skip SSL for -k and Follow redirects for -L. A command with a body but no method is imported as POST, as curl would send it.
Nothing is saved until you click Save: the panel shows "Request imported. Check the headers and body below before saving." so you can review the result first.
A few things are reported instead of imported: multipart form fields (-F), bodies read from a file (@file), options the check cannot represent (the import still completes and the panel lists each one), a second URL (only the first is used), and a header without a colon or with a line break. Only http and https URLs can be imported, and a command is limited to 100 KB.
Practical Use Cases
- Testing GET Requests: Verify that your API correctly retrieves data.
- Testing POST Requests: Ensure that your API can handle data creation or updates.
- Using Headers for Authentication: Pass authentication tokens in headers to access protected resources.
- Sending Complex Query Parameters: Test how your API handles complex queries.
By configuring these settings, you can tailor your API checks to match the exact requirements of your API endpoint, ensuring comprehensive testing and monitoring.