Skip to content
Download

allowOrigin

mach::CorsBuilder::allowMethod

Allows the specified method.

Allows requests using the specified HTTP method.

CorsBuilder& allowMethod(http::Method method);

A reference to the current CorsBuilder instance.

Parameter Description
method The method to allow.

This method may be called multiple times to allow multiple methods.

This method is not thread-safe and should only be called during CORS configuration.

cors.allowMethod(mach::http::Method::Get);
Name Description
allowMethods Allows multiple methods.