Adding HTTP Request to REST Service
A HTTP request describes the input to a HTTP method (as a collection of parameters) for the addressed resource.
In this task, you define the valid requests for the resources. In addition, you can define the request representation formats, and the schemas and examples to represent the HTTP requests.
To add a HTTP request
1. In CentraSite Business UI, access the Advanced Search panel in one of the following ways:
Click the
Browse link in the upper-left corner of the menu bar.
Click the
Search icon next to the
Scope list. The default search scope is
Assets.
This displays a list of assets in the Search Results page.
2. In the Additional Search Criteria list, select Asset Types.
3. To search for the assets of type, REST Service, click Choose.
This opens the Choose Asset Types dialog box.
4. In the Choose Asset Types dialog box, select the Assets option button, and then follow these steps:
a. Click the chevron next to Assets option button.
A list of defined asset types in CentraSite is displayed.
b. In the list of asset types, select REST Service.
c. Click OK.
A list of defined REST Service assets is displayed in the Search Results page.
5. Click the REST Service you want to add the HTTP Request Message.
This opens the REST Service details page. Also, the Actions bar displays a set of actions that are available for working with the REST Service.
6. On the Actions bar of the REST Service details page, click Edit.
7. Select the Resource and Methods profile.
8. On the Resource and Methods page, expand the resources and click Add Method.
9. Select Requests > Add Request.
This opens the Add Request dialog box.
10. In the Add Request dialog box, you can add a new request or select an existing global request defined in the Components page.
To add a new request
Provide the required information for each of the displayed data fields.
Field | Description |
Name | This is a label that you assign as a meaningful name of the HTTP Request. For example, you may call a HTTP Request of type application/xml, as XML Request or XML Payload. You may also call a HTTP Request based on the data that it holds. For example, you could specify a POST request to create new customer as Create Customer Request. |
Description | (Optional). The description for the HTTP Request. |
Request Content-Add Request Content (link) | The content format for the HTTP Request message. Click Add Request Content and provide the following information: a. Request Content-Type: It displays a list of the supported content formats for the REST Service. By default, this field shows an empty value. b. Schema: The REST Payload (HTTP Request message) using a JSON schema. c. Example: The REST Payload (HTTP Request message) with suitable examples to demonstrate the usage of a schema. An example is a JSON code. |
The newly created HTTP Request is added to the REST Method.
To select an existing request
a. On the Add Request page, click Choose.
b. On the Choose a Request page, enter search text and click the search icon.
c. A list of requests is displayed. Select the desired request and click OK.
d. A request page appears with the request details.
Note:
You cannot edit the requests referred from
Components in
Resource and Methods.
Deleting the request from
Resource and Methods removes it only from the REST Method.
You cannot delete a request in
Components, if a request is referred in the
Resource and Methods. You can delete the request from
Components after every association is removed from the
Resource and Methods.
The existing HTTP Request is added to the REST Method.
11. Click the chevron next to the HTTP Request for which you want to display the details.
12. To further update or delete a HTTP Request, hover over a particular HTTP Request.
This displays icons for one or more actions that you can perform on the HTTP Request.
13. Click Edit or Delete, as required.
14. To specify multiple HTTP Requests, click the Add Request link, and provide values for the new HTTP Requests.
15. Click Save.