Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4551050
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:34:53+00:00 2026-05-21T16:34:53+00:00

The webpage that I’m trying to access is sending back a 403 error. I’s

  • 0

The webpage that I’m trying to access is sending back a 403 error. I’s expecting WebViewClient to receive an error, but it doesn’t. Is it not supposed to get error?

engine.setWebViewClient(new WebViewClient() {
        boolean error = false;
        public void onReceivedError(WebView view, int errorCode,
                String description, String failingUrl) {

            //IT DOESN'T COME HERE even IF SERVER SENDS BACK 403 ERROR
        }
    });

It seams like, I’ll have to read the response using HttpRequest and parse the response to check what’s going on. Is there any other way to do this? Can I check headers from within the WebView?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:34:54+00:00Added an answer on May 21, 2026 at 4:34 pm

    I had to implement the requirement using two requests. First request to check if credentials are ok and that there’s no error(using HttpURLConnection). Only if the response is OK do I load the webview.

    protected Void doInBackground(final String... url) {
            boolean failed = false;
            int error = 0;
    
            try {
                URL urlToLoad = new URL(url[0]);
                HttpURLConnection conn = (HttpURLConnection) urlToLoad
                        .openConnection();
                int response = conn.getResponseCode();
                if (response != HttpURLConnection.HTTP_OK) {
                    error = response;
                    failed = true;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (!failed) {
                webView.loadUrl(url[0]);
            } else {
                handler.post(hideProgressRunnable);
                connecting = false;
                showError(ErrorMap.getErrorForHttpCode(error));
            }
            return null;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a webpage that allows the uploading of multiple files at
I have a webpage that is set to UTF-8 . But parts of its
I have a webpage that requires SSL, but this one line of Javascript appears
I have a webpage that pulls information from a database, converts it to .csv
There's a webpage that enables service providers to check customers insurance validity. The page
I have a webpage that is taking way too long and need to optimize
I have a webpage that implements a set of tabs each showing different content.
I have a webpage that I use h1 tags multiple times within various DIVs
Scenario: You have an ASP.Net webpage that should display the next image in a
Occasionally, I've come across a webpage that tries to pop open a new window

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.