If I install HttpClientParams.setRedirecting (params, false); Then the page returns "Fixed temporary broken link"
It looks like you are sending your request to the http:// URL and are counting on a redirect (perhaps via mod_rewrite or something like that, like redirecting in the PHP code itself) to turn your page into https .
This mode of operation first makes a simple HTTP request to the server, which then tells the client that the resource has moved to https:// . In turn, if automatic redirection is activated, the client makes a second request.
According to the HTTP specification, for status codes 301 or 302 (which are used for redirection),
If the status code 301/302 is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request if it cannot be confirmed by the user, as this can change the conditions under which the request was sent.
Most browsers interpret this as "if the first request was POST, do not forward the data for the redirected request, but make the second GET request anyway." This explains why you are losing the POSTed body for the second attempt.
Please note that for the reasons stated in this answer , over-reliance on rewriting / redirecting to refer the http:// request to the https:// request should be considered bad practice.
source share