Main Content

setHttpHeader

Set HTTP header for OSLC client

Since R2021a

    Description

    example

    setHttpHeader(myClient,header) assigns the custom HTTP header header to the OSLC client myClient. The custom header allows for HTTP methods. For more information, see matlab.net.http.HeaderField methods.

    Examples

    collapse all

    This example shows how to set a custom HTTP header for a configured OSLC client.

    Create a custom HTTP header by using the matlab.net.http.HeaderField class constructor.

    header = matlab.net.http.HeaderField('Content-Type','text/plain')
    header = 
    
      HeaderField with properties:
    
         Name: "Content-Type"
        Value: "text/plain"

    After you have created and configured an OSLC client as described in Create and Configure an OSLC Client for the Requirements Management Domain, assign the header to the OSLC client myClient.

    setHttpHeader(myClient,header);

    Input Arguments

    collapse all

    OSLC client, specified as an oslc.Client object.

    Custom HTTP header, specified as a matlab.net.http.HeaderField object.

    Tips

    Version History

    Introduced in R2021a