Generating HTTP Requests for Invoking Integrate Services
Aside from calling services via the browser (using the Invoke in Browser option), you can also call services from the HTTP Client. By dragging and dropping the service or API file1 to the HTTP Client view, the request will automatically be generated for you. You may then use this configuration to send requests to the server.
The HTTP Client supports the dragging and dropping of the following items:
- Gloop services (
- Groovy services (
- Flux services (
- Gloop REST API files (
.api) and operations
Not only will the HTTP client populate your parameters with the default values you've specified in your code, it will also populate headers and authentication data for you.
Invoke in HTTP Client
As an alternative to dragging and dropping a file to the HTTP Client, you may right click on a file and select Invoke in HTTP Client from the appearing context menu.
Default authentication type
When you drag and drop a service to the HTTP Client or use the context menu to invoke a service from it, the request's authentication type is set to Integrate session by default.
Invoking a Gloop Service
To invoke a Gloop service:
- Drag and drop the Gloop service file to the HTTP Client.
- Depending on your service and the type of call you want to make, populate the input data required and/or set the authentication.
- Click Send.
Invoking a Gloop REST API
You can drag and drop a Gloop REST API file (
.api) from the Coder Navigator to the
HTTP Client and the HTTP Client will generate a request for every operation exposed in the API.
Aside from files, you can also drag and drop a path or operation node from the Operations tab of the Gloop REST API editor. When you drag and drop a path node, the HTTP Client will generate requests for all operations under that path; when you drag and drop an operation node, the HTTP Client will create a request for invoking that HTTP operation. This allows you to have finer control over which requests that will be created.
Want to invoke Gloop REST API endpoints but don't want to drag and drop?
You can right click on a Gloop REST API file in the Coder Navigator view and select Invoke in HTTP Client from the appearing context menu to create a request in the HTTP Client. You can also do this on path and operation nodes while in the Operations tab of the Gloop REST API editor.
REST APIs may contain multiple paths, and each path may be comprised of multiple operations
Consider these operations from Swagger's Petstore API:
/petAdd a new pet to the store
/petUpdate an existing pet
/pet/findByStatusFind pets by status
You will notice that there are two paths in our list above:
path holds only one operation: the operation whose method is
GET; but the
/pet path has two operations, each
Set an HTTP request's response code by adding a request parameter named
When the REST API operation you're invoking in the HTTP Client has its
Mock property enabled to
true, then a
$gloopResponseCode query parameter can be added to the generated request in order to set the response code.
Invoking a Flux Service
To invoke a Flux service:
- Drag and drop the Flux service you want to invoke to the HTTP Client.
- Fill in the necessary inputs of the service which are either in the Parameter or Body tab.
- Specify the start state by setting the
- Click Send.
Invoking a Groovy Service
To invoke a Groovy service:
- Drag and drop the Groovy file you want to invoke from the Coder Navigator view to the HTTP Client.
- Select the method you want to invoke from the Service Picker. Once done, click OK.
- Supply the required inputs of the service.
- Click Send.
You can also create a request to a Groovy service while in the Groovy service editor by clicking the run button beside the method you want to call and then choosing Invoke <service> in HTTP Client.
Dragging and dropping of Gloop REST API paths or operations to the HTTP Client is also supported. ↩