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 6747873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:29:51+00:00 2026-05-26T12:29:51+00:00

I’m running a java code for getting info from a google-app-engine web service (testeserjaum.appspot.com),

  • 0

I’m running a java code for getting info from a google-app-engine web service (testeserjaum.appspot.com), but it always prints {null=[HTTP/1.1 302 Found], Date=[Wed, 26 Oct 2011 21:02:46 GMT], Content-Length=[0], Location=[https://testeserjaum.appspot.com/], Content-Type=[text/html], Server=[Google Frontend]} on the first System.out.println and null on the second one.

The funny fact is that, with other google-app-engine web services, the code works perfectly (i tried with testegelfur.appspot.com and it worked).

Here’s the code:

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class URLConnectionReader {
    public static void main(String[] args) throws MalformedURLException, IOException{
           URL url = new URL("http://testeserjaum.appspot.com/");
           HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
           System.out.println(urlConnection.getHeaderFields());
           try {
             InputStream in = new BufferedInputStream(urlConnection.getInputStream());
             BufferedReader buff = new BufferedReader(new InputStreamReader(in));
             System.out.println(buff.readLine());
           }finally{
             urlConnection.disconnect();
           }

    }
}

And, I don’t know if it helps, but here’s a python equivalent that actually works. I can’t use it because I plan to use this software on an android application, and I have a large amount of the software done, so this have to be done in java.

import urllib2
import base64

req = urllib2.Request('http://testeserjaum.appspot.com/')
req.add_header('User-Agent', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)')
#base64string = base64.encodestring('%s:%s' %('user', 'pass'))
#print base64string
#req.add_header("Authorization", "Basic %s" %base64string)
lol = urllib2.urlopen(req)
print lol.read()
  • 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-26T12:29:51+00:00Added an answer on May 26, 2026 at 12:29 pm

    HTTP 302 is a redirect, not an error. That’s why it’s called Found.

    Specifically, it tells the client to fetch https://testeserjaum.appspot.com/ instead of http://testeserjaum.appspot.com/.

    If you don’t want to deal with the redirect, just access https://testeserjaum.appspot.com/ directly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently running into a problem where an element is coming back from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build

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.