java, odpowiedź serwera 403

0

Mam problem, bo url na który normalnie wchodzę z przeglądarki jest niedostępny z poziomu javy... java rzuca wyjątek, że serwer zwrócił odpowiedź 403

try {
			url = new URL ( "http://www.ea.com/p/fut/a/card-pc/l/en_GB/s/p/ut/game/fifa13/user/accountinfo?timestamp=" + Kernel.timestamp.getTime() );
		}
		catch( java.net.MalformedURLException e ) {}
		
		try
		{
			   
			/**
			 * PHASE TWO
			 */
			System.out.println( "PHASE #2" );
			
			urlConn = ( HttpURLConnection ) url.openConnection();
			   // Let the RTS know that we want to do output.
			   urlConn.setDoOutput( true );
			   // No caching, we want the real thing.
			   urlConn.setUseCaches( false );
			   urlConn.setAllowUserInteraction( true );
			   // Specify the content type.
			   urlConn.setRequestProperty( "Content-Type", "application/x-www-form-urlencoded" );
			   urlConn.setRequestProperty( "Set-Cookie", _cookie );
			   
               // Get response data.
              input = new DataInputStream (urlConn.getInputStream ());
			   
			   String eaAuthResponse = "";
			   String str;
			   while( null != ( ( str = input.readLine() ) ) )
			   {
				   eaAuthResponse += str;
			   }
			   
			   System.out.println( eaAuthResponse );
			
			/////////////////////////////
		}
		catch( IOException e ) {
			System.out.println("Connection error (login): "+ e.toString());
			return;
		} 
0

masz zablokowany dostęp, musisz wysyłać nagłówku login i hasło

1 użytkowników online, w tym zalogowanych: 0, gości: 1