Closed

Source file from URL using Java: HttpResponseCode Error 403

Its getting source code from URL.

Except the one URL

It is showing error:

[login to view URL]: Server returned HTTP response code: 403 for URL:

import java.net.*;

import java.io.*;

public class Main

{

public static void main(String args[])

{

try {

URL urlObject = new URL("[login to view URL]");

URLConnection con = [login to view URL]();

[login to view URL]( "User-Agent", "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; H010818)" );

[login to view URL]( "length: "+[login to view URL]() );

[login to view URL]( "content: "+[login to view URL]() );

[login to view URL]( "type"+[login to view URL]() );

InputStream st = [login to view URL]();

int c;

while( (c=[login to view URL]()) != -1 ) {

[login to view URL]( (char)c );

}

//[login to view URL]("[login to view URL] :"+[login to view URL]());

//[login to view URL]("[login to view URL] :"+[login to view URL]());

}

catch ([login to view URL] exception){

[login to view URL]();

}

catch ([login to view URL] exception){

[login to view URL]();

}

}

}

Skills: Java

See more: java throw forbidden exception, java httpurlconnection server returned http response code 403 for url, server returned http response code 403 for url java, how to handle 403 forbidden error in java, java lang runtimeexception failed http error code 403, server returned http response code 403 for url eclipse, spring resttemplate 403 forbidden, java error 403 fix, multiple file upload using ajax php java, file upload using java script, gui source code file transfer chat java applications, parse xml file python using java, design sip client using java source code, file manager using java script html, pgp file encryption using java, post xml file url using vbscript, import excel file mysql using java, download file ftp using java swing, time taken send file destination using java code, send text file mobile using java

About the Employer:
( 0 reviews ) Rajam, India

Project ID: #18162918

6 freelancers are bidding on average ₹905 for this job

khangcnttit92

Hi nice to meet u . i can do it now!

₹1000 INR in 1 day
(114 Reviews)
5.9
fitashhaq

chane url to [login to view URL] and I have to write 100 characters so I am doing this if you find any other issue dont hesitate to contact me

₹650 INR in 1 day
(1 Review)
0.6
tranminhchausong

I can do it Relevant Skills and Experience Good java

₹950 INR in 1 day
(0 Reviews)
0.0
aditya007prakash

Java programmer for last 2 years and have relevant expertise and experience for this. I can do this. looking forward for your reply

₹750 INR in 1 day
(0 Reviews)
0.0
dharmajaya2011

i can fix it Relevant Skills and Experience java,centos,ubuntu,linux

₹1027 INR in 1 day
(1 Review)
0.0
SoftDevolmentKZ

You are trying to get a response from Google via http, and Google only works with https. And Google does not allow users to connect to [login to view URL] from countries that have their own local Google server, for example goog More

₹1050 INR in 1 day
(0 Reviews)
0.0