Yii Framework Forum: Yii2 rest Method Not Allowed? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii2 rest Method Not Allowed? Yii2 rest Method Not Allowed?

#1 User is offline   des1roer 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 10-February 15

Posted 29 July 2017 - 11:12 AM

https://github.com/des1roer/yii2test

Posted Image

config https://github.com/d.../config/web.php
api module https://github.com/d...ter/modules/api

how repair?
0

#2 User is offline   Patrick Jones 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 496
  • Joined: 14-July 12
  • Location:Berlin

Posted 29 July 2017 - 02:59 PM

Is this missing from your config?
http://www.yiiframew...uring-url-rules
Freelance developer for hire - send me a message!
0

#3 User is offline   des1roer 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 10-February 15

Posted 29 July 2017 - 09:56 PM

['class' => 'yii\rest\UrlRule', 'controller' => 'api/unit'], don`t work
0

#4 User is offline   Stefano Mtangoo 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 366
  • Joined: 02-January 12
  • Location:Dar es Salaam, Tanzania

Posted 24 February 2018 - 06:41 AM

If anyone hits same issue make sure that you have request enabled to handle JSON
'request' => [
	'parsers' => [
    	'application/json' => 'yii\web\JsonParser',
	]
]

And God said, Let there be science...and it was so! Jukwaa la wanaoongea Kiswahili Hapa, and its github repo here
0

#5 User is offline   Lifelogger 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 12-December 14

Posted 29 March 2018 - 07:48 AM

It seems you can not do a delete when you don't have a token set in the rules. For some reason the delete method is then not allowed.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users