![]()
WARNING You're browsing the documentation for an upcoming version of Laravel DataTables. The documentation and features of this release are subject to change.
HTML Builder Post AJAX
Use POST method to submit the DataTables AJAX request.
Basic Usage
use Yajra\DataTables\Html\Builder; $html = $builder->postAjax(route('users.data'));
With Custom Data
use Yajra\DataTables\Html\Builder; $html = $builder->postAjax([ 'url' => route('users.data'), 'data' => 'function(d) { d.key = "value"; }',]);
When to Use POST
| Use Case | Method | Reason |
|---|---|---|
| Small datasets | GET | Simpler, cacheable |
| Large datasets | POST | Avoid URL length limits |
| Internet Explorer | POST | Better compatibility |
| Sensitive data | POST | Data not in URL |
See Also
- HTML Builder AJAX - AJAX configuration
- HTML Builder Minified AJAX - Minified AJAX