Żeby nie być gołosłownym. RFC9110 głosi, co następuje:
The GET method requests transfer of a current selected representation for the target resource. A successful response reflects the quality of "sameness" identified by the target URI (Section 1.2.2 of [URI]). Hence, retrieving identifiable information via HTTP is usually performed by making a GET request on an identifier associated with the potential for providing that information in a 200 (OK) response. GET is the primary mechanism of information retrieval ...
I dalej:
When information retrieval is performed with a mechanism that constructs a target URI from user-provided information, such as the query fields of a form using GET, potentially sensitive data might be provided that would not be appropriate for disclosure within a URI (see Section 17.9). In some cases, the data can be filtered or transformed such that it would not reveal such information. In others, particularly when there is no benefit from caching a response, using the POST method (Section 9.3.3) instead of GET can transmit such information in the request content rather than within the target URI.
I dalej:
Request methods are considered "safe" if their defined semantics are essentially read-only; i.e., the client does not request, and does not expect, any state change on the origin server as a result of applying a safe method to a target resource. Likewise, reasonable use of a safe method is not expected to cause any harm, loss of property, or unusual burden on the origin server. This definition of safe methods does not prevent an implementation from including behavior that is potentially harmful, that is not entirely read-only, or that causes side effects while invoking a safe method. What is important, however, is that the client did not request that additional behavior and cannot be held accountable for it. For example, most servers append request information to access log files at the completion of every response, regardless of the method, and that is considered safe even though the log storage might become full and cause the server to fail. Likewise, a safe request initiated by selecting an advertisement on the Web will often have the side effect of charging an advertising account. Of the request methods defined by this specification, the GET, HEAD, OPTIONS, and TRACE methods are defined to be safe.
I dalej:
URIs are intended to be shared, not secured, even when they identify secure resources. URIs are often shown on displays, added to templates when a page is printed, and stored in a variety of unprotected bookmark lists. Many servers, proxies, and user agents log or display the target URI in places where it might be visible to third parties. It is therefore unwise to include information within a URI that is sensitive, personally identifiable, or a risk to disclose. When an application uses client-side mechanisms to construct a target URI out of user-provided information, such as the query fields of a form using GET, potentially sensitive data might be provided that would not be appropriate for disclosure within a URI. POST is often preferred in such cases because it usually doesn't construct a URI; instead, POST of a form transmits the potentially sensitive data in the request content. However, this hinders caching and uses an unsafe method for what would otherwise be a safe request.
I dalej:
The POST method requests that the target resource process the representation enclosed in the request according to the resource's own specific semantics. For example, POST is used for the following functions (among others):
Providing a block of data, such as the fields entered into an HTML form, to a data-handling process;
Posting a message to a bulletin board, newsgroup, mailing list, blog, or similar group of articles;
Creating a new resource that has yet to be identified by the origin server; and
Appending data to a resource's existing representation(s).
I dalej:
Responses to POST requests are only cacheable when they include explicit freshness information (see Section 4.2.1 of [CACHING]) and a Content-Location header field that has the same value as the POST's target URI (Section 8.7). A cached POST response can be reused to satisfy a later GET or HEAD request. In contrast, a POST request cannot be satisfied by a cached POST response because POST is potentially unsafe; see Section 4 of [CACHING].
W konsekwencji:
Pod względem tego jak "wrażliwe" są dane, to nie ma to żadnego znaczenia. Request HTTP to request, nie różni się praktycznie niczym, oprócz słowa GET/POST w nagłówku i tego czy ma body czy nie.
Nieprawda, specyfikacja jawnie głosi, że GET się nie nadaje do przesyłania wrażliwych danych, przynajmniej nie bez dodatkowego szyfrowania ich, usuwania ich, filtrowania ich itp.
Brednie Nie prawda, bo po pierwsze GET'em też możesz wysłać dane, np w nagłówku lub w query params; i postem też możesz odebrać dane, np w response body. Więc obiema metodami da się zarówno wysyłać i odbierać dane, różnica jest tylko w formie.
Nie mówię że powinno się wysyłać wrażliwe dane w query, w ulru, w headereach czy w body - to już zależy co chcesz osiągnąć, ale pod względem tego jaka to metoda to POST/GET są właściwie takie same.
Co do tego że określiłem to co napisałeś słowem "brednie", chodziło o Twoją wypowiedź "POST'em się wysyła, GET'em się odbiera". Tak jak rozumiem czemu ktoś mógłby tak to określić, tak to jest tożsama sytuacja co określenie "Nożem się kroi, a widelcem się nabija". Rozumiem, czemu ktoś by tak powiedział, ale niestety prawdą jest że widelcem też można coś przekroić, a nożem też można coś nabić; podobnie jak mimo że "POST'em się wysyła, GET'em się odbiera" tak można wysłać dane GET'em i odebrać POST'em - to miałem na myśli mówiąć "brednie", być może lepiej byłoby użyć słowa "prawdziwe inaczej".
Nieprawda, bo specyfikacja jawnie glosi, do czego służy GET, a do czego służy POST. Oczywiście, technicznie rzecz ujmując MOŻNA specyfikacji nie słuchać i robić po swojemu, a potem się dziwić, czemu nic nie działa, bo serwery cache'ujące żądania, przeglądarki, cały świat jednak słucha specyfikacji, a nie mojego widzimisię.
Jak sprecyzujesz dokładnie co znaczy "się robi", to zrozumiesz że to jest jakby preferencja, a nie faktyczna cecha HTTP.
Nieprawda, to jest określone w specyfikacji, a zresztą nawet gdyby to była tylko preferencja, to jeśli coś jest już de-facto standard, to należy uznawać to za standard.
Innymi słowy - jeśli coś da się wykraść z GET'a, to tak samo łatwo to wykraść z POST'a. Więc pod względem bezpieczeństwa - nie ma różnicy.
Poza tym, jeśli coś jest w stanie podglądnąć URL requestu, to jest w stanie podglądnąć też body. Więc użycie POST będzie tylko pozornie bardziej bezpieczne. Wylicz wszystkie miejsca gdzie używając GET'a możesz się narazić na wyciech danych - wszystkie te miejsca również są podatne na wyciek dla POST.
Cały zamysł mojej odpowiedzi, dotyczył tego, że umieszczając dane w POST, wcale nie sprawimy że te dane będą jakkolwiek "bardziej bezpieczne". Obie te rzeczy są zwykłymi requestami HTTP, obie są przekazywane przez przeglądarkę, sieć, server i analizowane przez aplikacje backendową. Owszem, są pewne konwencje i domyślne ustawienia które w tych czy innych przypadkach traktują te żądania inaczej; ale ostatecznie pod względem komunikacji między serverem a klientem to to jest to samo. Jeśli na drodze między serverem a klientem jest coś co może podglądnąć ten request, to tak samo POST jak i GET jest na to podatny. Nie dawajmy pytającemu złudnego wrażenia że może "ochronić swoje dane" zmieniając metodę HTTP.
Nieprawda. W skrajnie uproszczonym, przeteoretyzowanym modelu istotnie można twierdzić, że GET przesyłający dane w URLu vs. POST przesyłający dane w URLu vs. POST przesyłający dane w ciele żądania to jedno i to samo: można podsłuchać, jesli nie jest szyfrowane, nie można podsłuchać, jeśli jest szyfrowane. Jednak konwencje i specyfikacje są jakie są, a to oznacza, że wszelkie serwery pośredniczące, serwery logów, przeglądarki i ogólnie większość świata postępuje z metodami GET w taki sposób, a z metodami POST w inny sposób. W konsekwencji żądania GET będą cache'owane, logowane i zapisywane na prawo i lewo , podczas gdy żądania POST już mniej, a ciała żądań POST jeszcze mniej. Ergo twierdzić, że "nie ma różnicy" oraz "tak samo łatwo wykraść" to ciężka przesada i nieprawda, ponieważ łatwość wykradnięcia danych zależy od tego, jak różne serwery, narzędzia i oprogramowania się z nimi obchodzą! Załóżmy, że pr0 h4x0r przejął jakiś serwer cache. Czy z tego tytułu otrzymał dostęp do (a) historycznych żądań GET, czy (b) historycznych żądań POST? chyba jest jasne, która możliwość jest bardziej prawdopodobna. I Riddle jest tego świadomy, skoro sam pisze, że "są pewne konwencje i domyślne ustawienia które w tych czy innych przypadkach traktują te żądania inaczej".