URLConnection is a class that enables Java code to access data available from various urls.
Questions tagged [urlconnection]
674 questions
-1
votes
4 answers
What is the proper way to escape a URL for URLConnection.getInputStream()?
I'm having a really bizarre problem with URLConnection.getInputStream() when I have a space (' ') in the query string portion of a URI. Specifically, I have one URL that works and another that does not, when I think they should both fail or both…

Kenny
- 805
- 8
- 19
-1
votes
1 answer
twitter API call 500 error
how to handle the exception with URL connection when there is an "HTTP Error 500 Internal server" error from Twitter API .so how to handle it .i have coded this code in core java class and made a package for Twitter API call.
import java.net.*;…

user1393083
- 1
- 2
-2
votes
1 answer
java SocketTimeoutException
I am trying to read title from the https://www.groupon.pl/deals/ga-hotel-alpin-17 site (this is problem specific to this particular site)
address = "https://www.groupon.pl/deals/ga-hotel-alpin-17";
URL url = new URL(address);
URLConnection httpcon =…

supertramp
- 169
- 1
- 14
-2
votes
1 answer
this code works perfectly in java, but not i android
I am calling this in the main thread, in the onCreate method.
StringBuilder content = new StringBuilder();
try
{
URL url = new URL("http://alvinalexander.com/blog/post/java/java-how-read-from-url-string-text");
…

Rameez Jawaid
- 53
- 6
-2
votes
1 answer
Decode URL in Java
I need help decoding a URL found in a class inside a Java Archive (JAR), this might be malicious and want to see where it leads.
protected URLConnection openConnection(final URL paramURL)
throws IOException
{
new URLConnection(paramURL)
{
public…

infosec
- 39
- 6
-2
votes
2 answers
Write to a website using java
I am currently working on reading and writing to a website, only using Java. I have figured out how to read from the website, to get all the content on the actual website. But I am not completely sure where to begin with the writing, although it…
user7184133
-2
votes
2 answers
Java - URL connection does not seem to work
public void enviarCadena(String s){
s="http://192.168.1.7:36000/"+s;
try {
url = new URL(s);
conexion = url.openConnection();
} catch (MalformedURLException e) {
e.printStackTrace();
}catch (IOException e){
…

Kevin Lopez
- 63
- 1
- 9
-2
votes
1 answer
URLConnection on android
I'm trying to take the first image of a google search programmatically, to put it into my android application. i've found an example that was made for me(here: https://developers.google.com/image-search/v1/jsondevguide?hl=it#using_json) but i have…

Pelle
- 13
- 1
- 5
-2
votes
1 answer
URLConnection Android 4.2 doesn't work
Please help me. There is a simple application that displays by clicking the button in TextView code html page. I try to run on android 2.3 ... works. But on android 4.2 with pressing the error takes off "Unfortunately,name_app has…

Ruslan Fedotov
- 29
- 1
- 5
-3
votes
1 answer
How to add signature to URL
I'm making a UrlConnection and it requires a signature using SHA1.
I have already generate the signature but I don't know how to append it to the connection.
Here are my codes:
String url = domain + path
+"?api_key="+DEVELOPER_API_KEY
…

Weiheng Lian
- 21
- 4
-3
votes
1 answer
Bitmap Factory Error on InputStream Decode
I'm trying to make a simple function that grabs an image from an http connection. It was working before, now it's throwing some errors. I didn't make any changes to the code. Also the Input stream isn't null. It's returning expected data.
D/skia:…

Wnanjo
- 15
- 4
-3
votes
2 answers
calling URLconnection on another method
I have a problem when I want to use a variable of type URLConnection.
Here is my connectToServer() method:
private int connectToServer(){
try {
URL u = new URL("http://192.168.1.121:5000/");
URLConnection con =…

M. Agus Tri Mulyono
- 41
- 1
- 2
- 8
-6
votes
1 answer
Using Java to login into www.messenger.com
I am having trouble using code that I found to log into www.messenger.com. It seems like I am not able to write out form parameters because I do not have the right form names. I am having trouble finding the form name of the button and what to set…

user3315340
- 155
- 1
- 3
- 12
-7
votes
4 answers
Difference between URL and URLConnection?
What is the difference between URL and URLConnection, Can provide some examples or refer to me??

user3187883
- 59
- 1
- 4