Laravel JSON Request Validation: Disallow HTTP requests that do not accept JSON

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2021-02-20 (5 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 24 This week: 24All time: 10,158 This week: 10Up
Version License PHP version Categories
laravel-enforce-json 0.0.1MIT/X Consortium ...7.2HTTP, PHP 5, Validation
Description Author

This class is a middleware that can disallow HTTP requests that do not accept JSON.

It checks the current HTTP request to check the values for the Accept header.

The class will return HTTP status 400 if the application/json MIME type is not in the headers that the client accepts.

Picture of Thiago Przyczynski
  Performance   Level  
Name: Thiago Przyczynski <contact>
Classes: 9 packages by
Country: Brazil Brazil
Age: 31
All time rank: 3578281 in Brazil Brazil
Week rank: 15 Up1 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file License.txt Doc. Documentation
Plain text file README.md Class Class source

  Files folder image Files  /  src  
File Role Description
  Plain text file EnforceJson.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:24
This week:24
All time:10,158
This week:10Up

For more information send a message to info at phpclasses dot org.