i've configured rest api this: http://www.yiiframework.com/doc-2.0/guide-rest-quick-start.html
how make yii2 rest api output json default instead of xml?
from client use:
curl -i -h "accept:application/json" "http://localhost/myendpoint"
it seem json should default, yii2 it's xml. see:
restful response how return json instead of xml in yii2?
and/or dig deeper docs: http://yiiframework.com/doc-2.0/yii-filters-contentnegotiator.html
Comments
Post a Comment