Sending OData endpoint batch requests
To test services that use OData protocol, you can send requests in a batch. The request contains HTTP operations such as GET, POST, and PUT to manage data in the service.
Before you begin
About this task
When you send requests in a batch, you can group a set of operations into one HTTP request. You can start a batch request from GSC or from a service test. To initiate a batch request from a service test in the Test editor, select multiple requests to include in a batch, right-click and select $batch odata requests.
To initiate a batch request from GSC, complete the following steps:
Procedure
- Click the Open the Generic Service Client toolbar button and select the Requests page.
- Click the Add icon and click a type of request that you want to send or in Request Library, right-click EndPoints and select Send a Batch Request.
- In the ODATA batch information page, select the OData version that your application supports.
-
To set HTTP headers, ensure that the Set ODATA batch request http
headers radio button is selected.
If needed, you can change the headers on the next page of the wizard.
- To group appropriate requests into change sets, select the ODATA batch with changesets radio button.
-
In Selection of calls to batch, select the requests to include in the
batch.
If you initiated the batch request from the service test, the requests are already selected.
- Click Next.
-
In the Configure Protocol window, select HTTP and
specify the HTTP transport configuration.
If necessary, click New to create an HTTP transport configuration for the call.
To send the HTTP/2 requests, in the Create HTTP Protocol configuration window, click the Activate check box. Before capturing the HTTP/2 traffic, configure the computer. See Preparing to record a test for the HTTP/2 service for instructions.
-
Click Finish.
The request is added to the Endpoints section of the Request Library.
-
In the Request Library, select the request element.
The generic service client shows three steps: Edit Request, Invoke, and View Response. The details for the request are displayed under the Edit Request step.
-
On the Transport page, if necessary, change the transport configuration to
be used by the request.
To create and edit transport and security configurations, use the Transport tab.
-
When you are ready, click Invoke to send the service request.
The generic service client sends the request and displays the message return under the View Response step.