29 if ( $contentType !==
'application/json' ) {
32 [
'content_type' => $contentType ]
38 self::PARAM_SOURCE =>
'body',
43 self::PARAM_SOURCE =>
'body',
48 self::PARAM_SOURCE =>
'body',
53 self::PARAM_SOURCE =>
'body',
68 $contentmodel = $body[
'content_model'] ?:
null;
70 if ( $contentmodel !==
null && !$this->contentHandlerFactory->isDefinedModel( $contentmodel ) ) {
72 new MessageValue(
'rest-bad-content-model', [ $body[
'content_model'] ] ), 400
81 'text' => $body[
'source'],
82 'summary' => $body[
'comment'],
87 if ( $contentmodel !==
null ) {
88 $params[
'contentmodel'] = $contentmodel;
96 array $actionModuleResult,
99 parent::mapActionModuleResponse(
100 $actionModuleResponse,
105 $title = $this->
urlEncodeTitle( $actionModuleResult[
'edit'][
'title'] );
107 $url = $this->
getRouter()->getRouteUrl(
'/v1/page/' . $title );
108 $response->
setHeader(
'Location', $url );
getTokenParamDefinition()
Returns the definition for the token parameter, to be used in getBodyValidator().
getToken()
Determines the CSRF token to be used, possibly taking it from a request parameter.
Do-nothing body validator.