Android volley to handle redirect

前端 未结 8 1205
名媛妹妹
名媛妹妹 2020-11-27 18:43

I recently started to use Volley lib from Google for my network requests. One of my requests get error 301 for redirect, so my question is that can volley handle redirect so

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 19:31

    Volley supports redirection without any patches, no need for a separate fork

    Explanation: Volley internally uses HttpClient which by default follows 301/302 unless specified otherwise

    From: http://hc.apache.org/httpcomponents-client-4.2.x/tutorial/html/httpagent.html

    ClientPNames.HANDLE_REDIRECTS='http.protocol.handle-redirects': defines whether redirects should be handled automatically. This parameter expects a value of type java.lang.Boolean. If this parameter is not set HttpClient will handle redirects automatically.

提交回复
热议问题