REST Request Headers

If required, you can add HTTP header fields to REST requests used in an upload operation. You can do this with any REST framework unless noted otherwise.

You can only add request headers to PUT, PATCH, POST, and DELETE operations. Additional request headers are not supported at download (GET operation).

During an upload, the add-in prepares the REST request as usual with the standard HTTP header fields. If the corresponding operation has additional headers defined, these values are evaluated and the headers added.

Reserved headers are skipped with no error. See Notes on REST Request Headers.

The add-in does not validate the header names or values. Be sure to consult the documentation for your target service before attempting to use request headers. An incorrect header may result in "Bad Request" errors.

Configure a Request Header

You can add REST request headers using the Operation Editor available from a business object’s Business Object Editor.

The value you enter should be a string. If you want to use a non-string value, such as a date value, consult the REST service documentation to determine how the header should be formatted.

Header values can also include an expression. If you use an expression, make sure to follow the Oracle Visual Builder Add-in for Excel expression rules, in particular the rules for escaping ({ }) and using literal values. Reserved words, other than RowVariables, are not supported. See About Expressions.

You can define headers for child business objects as well. But keep in mind that, if the child data is sent in the parent payload, any child headers are ignored since the add-in does not send requests at the descendent level. See Upload Parent and Child Changes in the Same Payload.

This feature supports the use of date effective objects in a workbook. Changes to date effective objects are uploaded to the service based on a range start date. To support this, you'll need to add a date field, called a "row variable", to your layout that your business users can use to enter the start date for a row. See Use Row Variables for a Business Object.

You can use Request Headers support to include the Effective-Of header, if desired. See EffectiveOf Headers in Multi-Row Requests.

This task uses the example of an Effective-Of header on the PATCH operation that refers to a row's row variable, rangeStartDate.

To add an HTTP Request header to a business object:

  1. Open the Business Object Editor for the business object. You can open the editor from the Layout Designer or by clicking Manage Catalogs from the Visual Builder ribbon.
  2. From the General tab, click the Edit button next to the Collection Path or the Item Path to open the Path Editor. See REST Operations for more information on paths and operations.
  3. From the Path Editor, select the desired operation and click the Edit Operation icon (Edit Operation).
  4. From the Headers tab of the Operation Editor, click Add a new header (Add a new header).
  5. Select the desired header name (or type the name if it is not in the list); for example, effective-Of. Note that header names are case-insensitive.
  6. Type the desired value; for example, RangeMode=UPDATE;RangeStartDate={ this.BusinessObject.RowVariables['rangeStartDate'].Value }.


    In this example, the RangeStartDate attribute is set to the value of the row variable, rangeStartDate, in the selected layout.

  7. Click Done.

Once you add a header, the workbook can no longer be used with versions 3.6 or earlier.

Before you distribute the workbook, it is recommended that you test the defined headers by opening the Network Monitor and upload a change using the Upload Changes Data button from the Oracle Visual Builder ribbon. The Network Monitor shows the add-in's requests and the service's responses. See Network Monitor.

If you experience issues, try modifying the request header value and then clicking Upload Changes again.

Notes on REST Request Headers

Review this section for more information on reserved headers and limitations.

Reserved Headers

Some HTTP header fields are reserved by the add-in. If you use one of these headers for a REST request, the add-in will ignore it.

The reserved HTTP header fields are:

  • User-Agent
  • Authorization
  • Accept
  • Content-Encoding
  • Host
  • Content-Length
  • REST-Framework-Version
  • Accept-language
  • Accept-Encoding
  • Content-Type

Limitations

  • Headers defined for GET operations are ignored. These include operations for download, lists of values (LOV), describe, and so on.
  • Request headers are not supported for ADF REST multi-row requests except for the Effective-Of header. See EffectiveOf Headers in Multi-Row Requests.
  • Headers are not supported for attachment business objects.
  • Headers are not supported for custom actions.
  • For ADF REST services, do not add the Upsert-Mode header on the POST operation for the collection path. Instead, enable Upsert Mode from the Upload tab of the Business Object Editor. See Upload Changes Using Upsert Mode.