Android Question HttpUtils2 error 403

Discussion in 'Android Questions' started by magarcan, Mar 13, 2015.

  1. magarcan

    magarcan Active Member Licensed User

    Hi! I'm using HttpUtils2 for downloading html file of a site.
    Uri is similar to this: The problem is that instead of the html file, I get a different one thelling something like this:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        <title>Error 403 Keep Honking</title>
        <hr><h1>Keep Honking</h1>
    Keep Honking
    I've tried adding index.htm, index.html, index.php to the uri, but I get error 404 instead.

    Any idea?
  2. KMatle

    KMatle Expert Licensed User

    403 means that you don't have permission to download it (folder).

    Is it your own server? There's a config file in which the owner can put own messages for 404 (not found) or here 403
  3. magarcan

    magarcan Active Member Licensed User

    I've just needed to add this:
    req.SetHeader("User-Agent""Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"'Without this line it will fail (FORBIDDEN error)
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice