Page Contents

Home > @loopback/rest > RestHttpErrors > unsupportedMediaType

RestHttpErrors.unsupportedMediaType() function

Signature:

function unsupportedMediaType(contentType: string, allowedTypes?: string[]): HttpErrors.HttpError<415> & {
        code: string;
        contentType: string;
        allowedMediaTypes: string[];
    };

Parameters

Parameter Type Description
contentType string  
allowedTypes string[] (Optional)

Returns:

HttpErrors.HttpError<415> & { code: string; contentType: string; allowedMediaTypes: string[]; }