Skip to main content

Operations

Operations correspondend to service methods. You may create multiple operations for one service method. The operations can be organised into folders. Note that this folder structure is stored and read directly from the file system. That is why some characters are forbidden in folder and file names and why the operations are always sorted alphabetically.

gRPC

gRPC operations have some specialties. For example, gRPC supports multiple requests and responses in an operation. In addition, a Kreya gRPC operation must always correspondend to a service method of the gRPC service.

Sending requests manually

In case of bidirectional or client-streaming methods, operations may contain multiple requests. By default, sending (or "invoking") an operation with multiple requests will send them one after another as soon as possible. If this does not suit you, select the 'Send requests manually' option from the 'Send' button dropdown. With it, you have complete control over the sending of requests.

Creating a gRPC operation

Add a new operation by clicking the icon. Choose a descriptive name and select the desired gRPC package, service and method.

Modifying gRPC requests

Request contents can be modified by editing the JSON content directly in the editor. Adding requests is possible with the 'Add request' button, if the current operation supports multiple requests. To delete requests, hover over the requests header and click the trash can icon twice.

REST

REST operations also have their specialities, since the request and response types are completely dynamic. For example, an endpoint may receive JSON and reply with XML or a PDF.

Creating a REST operation

Add a new operation by clicking the icon. Next, choose a descriptive name for your operation.

If you imported REST API definitions, you can use an imported API operation as a template by clicking the checkbox and selecting the desired operation. Should you leave the checkbox unselected or if you did not import any API definitions, Kreya will simply create an empty REST operation.

Changing the request content type

By default, Kreya generates an example request based on the OpenAPI definition. If Kreya cannot find a request definition, the default request content is empty. To change that, click on the request content type tab and select the desired type.

REST multipart form requests

Sending multipart requests with Kreya is pretty easy. Simply select the "Multipart" request type. Then, you can start adding and removing "parts". Note that a "part" must have a name. To delete parts, hover over the part header and click the trash can icon twice.