Share via


CorsOptions Class

Definition

Defines options to control Cross-Origin Resource Sharing (CORS) for an index.

public class CorsOptions : System.ClientModel.Primitives.IJsonModel<Azure.Search.Documents.Indexes.Models.CorsOptions>, System.ClientModel.Primitives.IPersistableModel<Azure.Search.Documents.Indexes.Models.CorsOptions>
type CorsOptions = class
    interface IJsonModel<CorsOptions>
    interface IPersistableModel<CorsOptions>
Public Class CorsOptions
Implements IJsonModel(Of CorsOptions), IPersistableModel(Of CorsOptions)
Inheritance
CorsOptions
Implements

Constructors

CorsOptions(IEnumerable<String>)

Initializes a new instance of CorsOptions.

Properties

AllowedOrigins

The list of origins from which JavaScript code will be granted access to your index. Can contain a list of hosts of the form {protocol}://{fully-qualified-___domain-name}[:{port#}], or a single '*' to allow all origins (not recommended).

MaxAgeInSeconds

The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes.

Methods

JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)

Explicit Interface Implementations

IJsonModel<CorsOptions>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<CorsOptions>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<CorsOptions>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<CorsOptions>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<CorsOptions>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to