question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

data-method="post" - not working proper on PHP

See original GitHub issue

Bootstraptable version(s) affected: v1.18.3

Description
when using the attribute

data-method="post"

the browser show it as POST

   snap509

but PHP v7.4 replies an empty array

   snap511

Example

<table
				id="table"
				data-toggle="table"
				data-search="true"
				data-method="post"
				data-url="entities/countryHelper.php"
				data-side-pagination="server"				
				data-pagination="true">
				<thead>
					<tr>
						<th data-field="title">ID</th>
						<th data-field="code">Item Name</th>
						<th data-field="flag">Item Price</th>
					</tr>
				</thead>
</table>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wenzhixincommented, Oct 19, 2021

To make sure that when our REST API app responds with JSON that clients interpret it as such, we should set Content-Type in the response header to application/json after the request is made.

@UtechtDustin https://stackoverflow.blog/2020/03/02/best-practices-for-rest-api-design/

I think this issue can be closed.

1reaction
wenzhixincommented, Oct 18, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

PHP $_POST not working? [duplicate] - Stack Overflow
Make sure that the "action" attribute on your form leads to the correct destination. Try using $_REQUEST[] instead of $_POST, see if there...
Read more >
$_POST - Manual - PHP
If you want to receive application/json post data in your script you can not use $_POST. $_POST does only handle form data. Read...
Read more >
PHP POST Method: Understand the Best Method With An ...
In the PHP POST method, data from HTML FORM is submitted/collected using a super global variable $_POST. This method sends the encoded ...
Read more >
PHP - GET & POST Methods - Tutorialspoint
The POST method does not have any restriction on data size to be sent. The POST method can be used to send ASCII...
Read more >
why form post not working [SOLVED] - php - Daniweb
hi Dear, in form tag action is missing so put <form method="POST" action="index.php">. hope it works for you.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found