google / volley

https://google.github.io/volley
Apache License 2.0
3.37k stars 751 forks source link

Unexpected response code 511 for #432

Closed dariolr closed 2 years ago

dariolr commented 2 years ago

i recieve this error while calling this method

private void updateCodStaToFidelityOnServer(final int codCli, final int prgFid, final int codFid) {
    String url = "https://www.mydomain.net/myfile.php";
    RequestQueue myRequestQueue = Volley.newRequestQueue(this);
    StringRequest
            myStringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {
        @Override
        public void onResponse(String response) {
            //This code is executed if the server responds, whether or not the response contains data.
        }
    }, new Response.ErrorListener() { //Create an error listener to handle errors appropriately.
        @Override
        public void onErrorResponse(VolleyError error) {
            //This code is executed if there is an error.
        }
    }) {
        protected Map<String, String> getParams() {
            Map<String, String> myData = new HashMap<>();
            myData.put("codCli", String.valueOf(codCli));
            myData.put("prgFid", String.valueOf(prgFid));
            myData.put("codFid", String.valueOf(codFid));
            return myData;
        }
    };
    myRequestQueue.add(myStringRequest);
}

any help? thanks

jpd236 commented 2 years ago

That means the server you're trying to connect to is responding with an error (511). There's no indication of anything going wrong on the Volley side here. Would recommend you look at the server logs or otherwise investigate from that end; you might also be able to investigate the NetworkResponse data in onErrorResponse depending on whether the server returns anything useful there. But you'd see the same problem with HttpUrlRequest, even if Volley weren't being used.

Closing as this does not appear to be a Volley problem. Please reopen if you are seeing different behavior with HttpUrlRequest.