MediaWiki master
UnsupportedContentTypeBodyValidator.php
Go to the documentation of this file.
1<?php
2
4
8
22
24 private string $contentType;
25
29 public function __construct( string $contentType ) {
30 $this->contentType = $contentType;
31 }
32
37 public function validateBody( RequestInterface $request ) {
38 throw new LocalizedHttpException(
39 new MessageValue( 'rest-unsupported-content-type', [ $this->contentType ] ),
40 415
41 );
42 }
43
44}
validateBody(RequestInterface $request)
Validate the body of a request.This may return a data structure representing the parsed body....
Value object representing a message for i18n.
A request interface similar to PSR-7's ServerRequestInterface.
Interface for validating a request body.