If 'default_return_type' => 'html', use the json() function in the return of the controller method to specify the output type as json,
Otherwise, 'default_return_type' => 'json', How does the controller specify html as the output type?
jasen_12020-03-15 15:12:09
I just took a closer look at the document and asked myself some questions. public function hello() { $data = 'Hello,ThinkPHP!'; return response($data); },
See the response output chapter.