Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

createCORSResponse

  • createCORSResponse(origin: string, methods?: string[], headers?: string[]): TwilioResponse
  • Create a new TwilioResponse with CORS headers.

    The origin parameter is required, but passing in * will allow access from any origin.

    Usage: const response = createCORSResponse('*');

    Parameters

    • origin: string

      A URL string representing an origin, or * for any origin.

    • methods: string[] = ...

      A list of HTTP methods whose use is allowed by clients.

    • headers: string[] = ...

      A list of HTTP headers that can be used in a client's request.

    Returns TwilioResponse

    A TwilioResponse with CORS headers for the given origin, methods, and headers.

Generated using TypeDoc