hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Error using import org.apache.commons.httpclient.*
Date Sun, 07 Mar 2010 18:42:39 GMT
On 07/03/2010, HughT <nadinemoacdieh@gmail.com> wrote:
>
>
>  I'm trying to automate sending an SMS message from one phone to another. I
>  want to be able to login to a website that sends free SMS messages and then
>  send a message from there, all within Java. Is this a reasonable aim or is
>  it not feasible/overly complicated with HTTPClient?

That entirely depends on what the website requires, and whether they
change the mechanism regularly or not. If they use a lot of Javascript
and dynamic variables it could quickly become very tedious.

And if they start requiring a CAPTCHA it will probably become
impossible without human intervention (the resources available on a
phone are unlikely to be sufficient to decode these for a few years
yet!).

It also depends on how experienced you are with HTTP and Java.

>
>
>  sebb-2-2 wrote:
>  >
>  > On 07/03/2010, HughT <nadinemoacdieh@gmail.com> wrote:
>  >>
>  >>  Hmmm... Well, the error disappeared for the time being, which is why I
>  >>  assumed that it worked. So I take it I should remove HTTPClient
>  >> 4.1-alpha1,
>  >>  most probably... Thanks once more.
>  >
>  > I meant that you don't need all the jars.
>  >
>  >>  Seems working with Apache is going to more complicated than I thought.
>  >
>  > Working with any library that is not in the standard Java release is
>  > going to require similar research to find out what dependencies are
>  > needed.
>  >
>  >>  All I
>  >>  want is to be able to login to a website using a username and password
>  >> and
>  >>  then do whatever I want in the site (click buttons, write messages,
>  >> etc.),
>  >>  all through Java code.
>  >
>  > That's potentially a lot of work.
>  > But it would be a lot of work with the standard Java classes as well.
>  >
>  >>  I searched a lot and found that HTTPClient is the best for this kind of
>  >>  stuff. Am I mistaken in this respect?
>  >
>  > No.
>  >
>  >> Is there a better way?
>  >
>  > That depends on what you are ultimately trying to achieve.
>  >
>  > For example:
>  >
>  > Are you trying to learn HTTP programming?
>  > Are you trying to test a website?
>  > Automate some process?
>  >
>  >>
>  >>
>  >>
>  >>
>  >>  sebb-2-2 wrote:
>  >>  >
>  >>  > Something is probably still wrong, as you now have both HttpClient 3.1
>  >>  > and HttpClient 4.1-alpha1.
>  >>  >
>  >>  > You should not need both unless you are writing quite an unusual
>  >>  > application.
>  >>  >
>  >>  > Note the HC 4.1 is not compatible with HC 3.1.
>  >>  >
>  >>  > Code for 3.1 needs to be rewritten to use 4.1 - they have different
>  >>  > package names and different architecture.
>  >>  >
>  >>  > On 07/03/2010, HughT <nadinemoacdieh@gmail.com> wrote:
>  >>  >>
>  >>  >>
>  >>  >>  Thanks for all your help! It works now, I looked up the page you
>  >>  >> suggested
>  >>  >>  and turns out I still needed commons-codec, httpcore,
>  >>  >>  commons-httpclient-3.1, and http-client-4.1-alpha1. Thanks again.
>  >>  >>
>  >>  >>
>  >>  >>
>  >>  >>
>  >>  >>  sebb-2-2 wrote:
>  >>  >>  >
>  >>  >>  > On 07/03/2010, HughT <nadinemoacdieh@gmail.com> wrote:
>  >>  >>  >>
>  >>  >>  >>  Hello,
>  >>  >>  >>
>  >>  >>  >>  I'm new to Apache and I'm trying to use HttpClient in
Java, but
>  >> just
>  >>  >>  >> can't
>  >>  >>  >>  seem to be able to get the right jar file for some reason.
I
>  >> keep
>  >>  >>  >> getting an
>  >>  >>  >>  error that the package org.apache.commons.httpclient does
not
>  >> exist.
>  >>  >> I
>  >>  >>  >>  downloaded almost every related jar file I could find,
but it is
>  >>  >> still
>  >>  >>  >> not
>  >>  >>  >>  working. These are the jar files I have so far:
>  >>  >>  >>
>  >>  >>  >>  commons-email-1.2
>  >>  >>  >>  httpclient-4.0.1
>  >>  >>  >>  httpmime-4.0.1
>  >>  >>  >
>  >>  >>  > You also need
>  >>  >>  >
>  >>  >>  > commons-codec
>  >>  >>  > httpcore
>  >>  >>  >
>  >>  >>  > see:
>  >>  >>  >
>  >>  >>  >
>  >>  >>
>  >> http://hc.apache.org/httpcomponents-client/httpclient/dependencies.html
>  >>  >>  >
>  >>  >>  >>  activation
>  >>  >>  >>  dsn
>  >>  >>  >>  imap
>  >>  >>  >>  mailapi
>  >>  >>  >>  pop3
>  >>  >>  >>  smtp
>  >>  >>  >>  mail
>  >>  >>  >>  commons-email-javadoc/sources
>  >>  >>  >>  commons-logging-...
>  >>  >>  >>  commons-collections-...
>  >>  >>  >>  commons-net-2.0-...
>  >>  >>  >>  jakarta-oro-2.0
>  >>  >>  >>
>  >>  >>  >>  I'm sure many of these are absolutely useless, but I was
growing
>  >>  >>  >> desperate.
>  >>  >>  >>  I just need to import org.apache.commons.httpclient.*
into Java.
>  >> If
>  >>  >>  >> someone
>  >>  >>  >>  could please let me know what exactly it is I need to
download,
>  >> jar
>  >>  >> file
>  >>  >>  >> or
>  >>  >>  >>  other, I would be extremely grateful!
>  >>  >>  >
>  >>  >>  > Check the dependency details on the websites.
>  >>  >>  >
>  >>  >>  >>  Hugh
>  >>  >>  >>
>  >>  >>  >> --
>  >>  >>  >>  View this message in context:
>  >>  >>  >>
>  >>  >>
>  >> http://old.nabble.com/Error-using-import-org.apache.commons.httpclient.*-tp27809614p27809614.html
>  >>  >>  >>  Sent from the HttpClient-User mailing list archive at
>  >> Nabble.com.
>  >>  >>  >>
>  >>  >>  >>
>  >>  >>  >>
>  >>  >> ---------------------------------------------------------------------
>  >>  >>  >>  To unsubscribe, e-mail:
>  >> httpclient-users-unsubscribe@hc.apache.org
>  >>  >>  >>  For additional commands, e-mail:
>  >> httpclient-users-help@hc.apache.org
>  >>  >>  >>
>  >>  >>  >>
>  >>  >>  >
>  >>  >>  >
>  >> ---------------------------------------------------------------------
>  >>  >>  > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  >>  >>  > For additional commands, e-mail:
>  >> httpclient-users-help@hc.apache.org
>  >>  >>  >
>  >>  >>  >
>  >>  >>  >
>  >>  >>
>  >>  >>
>  >>  >> --
>  >>  >>  View this message in context:
>  >>  >>
>  >> http://old.nabble.com/Error-using-import-org.apache.commons.httpclient.*-tp27809614p27811609.html
>  >>  >>
>  >>  >> Sent from the HttpClient-User mailing list archive at Nabble.com.
>  >>  >>
>  >>  >>
>  >>  >>
>  >> ---------------------------------------------------------------------
>  >>  >>  To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  >>  >>  For additional commands, e-mail: httpclient-users-help@hc.apache.org
>  >>  >>
>  >>  >>
>  >>  >
>  >>  > ---------------------------------------------------------------------
>  >>  > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  >>  > For additional commands, e-mail: httpclient-users-help@hc.apache.org
>  >>  >
>  >>  >
>  >>  >
>  >>
>  >>  --
>  >>
>  >> View this message in context:
>  >> http://old.nabble.com/Error-using-import-org.apache.commons.httpclient.*-tp27809614p27811792.html
>  >>
>  >> Sent from the HttpClient-User mailing list archive at Nabble.com.
>  >>
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  >>  For additional commands, e-mail: httpclient-users-help@hc.apache.org
>  >>
>  >>
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  > For additional commands, e-mail: httpclient-users-help@hc.apache.org
>  >
>  >
>  >
>
>  --
>
> View this message in context: http://old.nabble.com/Error-using-import-org.apache.commons.httpclient.*-tp27809614p27812374.html
>
> Sent from the HttpClient-User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message