Software AG Products 10.5 | Using CentraSite | Asset Management | Managing Assets through CentraSite Business UI | REST Service Management | Adding REST Service from Scratch | Adding HTTP Request to REST Service
 
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. In the Add/Modify Method dialog box, click the chevron to expand the area labeled Requests.
9. Click the Add Request link.
This opens the Add Request dialog box.
10. In the Add Request dialog box, 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-Type
The content format for the HTTP Request message. (The Request Content-Type displays a list of the supported content formats for the REST Service.) By default, this field shows an empty value.
Schema
(Optional). The REST Payload (HTTP Request message) using an XML schema or JSON schema.
Inline or External File
Specifies if the schema definition will be read from an inline text (the Inline option) or from an external file or URL (the External File option).
To use an inline schema, type the schema definition in the Inline text box.
To use an external schema, do the following:
*If the schema definition you are uploading resides on the network, specify its URL.
*If the schema definition resides in an external file, specify the file name. You can use the Browse button to navigate to the required folder.
Note:
As a best practice, you should use the Inline option to include small number of data and use the External File option to include large number of data stored in an external file.
Example
(Optional). The REST Payload (HTTP Request message) with suitable examples to demonstrate the usage of a schema. An example is an XML code or JSON code.
Inline or External File
Specifies if the example will be read from an inline example code (the Inline option) or from an external file or URL (the External File option).
To use an inline example, type the example code in the Inline text box.
To use an external example, do the following:
*If the example you are uploading resides on the network, specify its URL.
*If the example resides in an external file, specify the file name. You can use the Browse button to navigate to the required folder.
Note:
As a best practice, you should use the Inline option to include small number of data and use the External File option to include large number of data stored in an external file.
The newly created 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.