What is the difference between $_GET and $_POST?

Asked

Viewed 1,618 times

-4

Could they explain in detail what they are? And also give examples of how they work?

  • 6
  • 6
  • 1

    The problem with these related questions is the title. I would never think so, but that’s okay. Thanks for the help.

  • 3
  • 3
  • 4

    Yes, Lucas. It’s almost impossible to find anything in the site search, I understand well.

  • 2

    I did not deny the question, however by poor quality of response that received the questions that Linkei answer much better, GET and POST is not a matter of visibility, so much so that the POST can receive different types of data on payload, the difference is much greater.

  • The only difference between the 2 is that it doesn’t appear in the URL? Testing here seems like that’s all..

  • 1

    @Lucascarvale this only in browsers, the HTTP protocol goes far beyond browsers, if you use in a call via Java in an android application, both will be invisible. The difference between POST and GET is in the way that transmits the data, remember POST can receive more than one type of data format (payload), see this answer: https://answall.com/a/50989/3635, then I detail more about the formats

  • Thank you very much, William!!

  • In the form, the method="POST" and method="post" have difference?

  • 1

    @Lucascarvalho has no difference, both are equal, browser treats everything to fix and prevent problems even method="PoSt" will work

Show 7 more comments

1 answer

1

The big difference between GET and POST methods is probably visibility. A GET request is sent as a string attached to the URL, while the POST request is encapsulated next to the HTTP request body and cannot be seen

Browser other questions tagged

You are not signed in. Login or sign up in order to post.