Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > HTTPClient: specifying url string

Reply
Thread Tools

HTTPClient: specifying url string

 
 
Dale
Guest
Posts: n/a
 
      11-10-2003
I need a little assistance with pulling down a page using HTTPClient,
if someone with experience has a moment...

Name value pairs handled through NVPair are fine, but what about if I
want to read a page normally reached like this:

http://some.domain.com/somePath/some...1&name2=value2

domain = "some.domain.com";
page = "somePath/someProggy.dll";
formData = new NVPair[] {new NVPair("name1", "value1"),new
NVPair("name2", "value2")};

But where does "ThisGuy" go?

I tried NVPair with "" and null - no-go. That emulates "ThisGuy=",
and the page I'm going after doesn't like that.

Thanks for reading!

--Dale--
 
Reply With Quote
 
 
 
 
jock
Guest
Posts: n/a
 
      11-10-2003


Dale wrote:
>
> I need a little assistance with pulling down a page using HTTPClient,
> if someone with experience has a moment...
>
> Name value pairs handled through NVPair are fine, but what about if I
> want to read a page normally reached like this:
>
> http://some.domain.com/somePath/some...1&name2=value2
>
> domain = "some.domain.com";
> page = "somePath/someProggy.dll";
> formData = new NVPair[] {new NVPair("name1", "value1"),new
> NVPair("name2", "value2")};
>
> But where does "ThisGuy" go?
>
> I tried NVPair with "" and null - no-go. That emulates "ThisGuy=",
> and the page I'm going after doesn't like that.
>
> Thanks for reading!
>
> --Dale--


I'm not sure about that (I worked a lot with POST method),
but you could allocate a GetMethod object like

GetMethod get = new
GetMethod("http://some.domain.com/somePath/someProggy.dll?ThisGuy&name1=value1&name2=value2") ;

and than do something like that

HttpClient client=new HttpClient();
client.executeMethod(get);

Let me know if it work
Cheers
jock
 
Reply With Quote
 
 
 
 
Dale
Guest
Posts: n/a
 
      11-11-2003
jock <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Dale wrote:
> >
> > Name value pairs handled through NVPair are fine, but what about if I
> > want to read a page normally reached like this:
> >
> > http://some.domain.com/somePath/some...1&name2=value2
> >
> > domain = "some.domain.com";
> > page = "somePath/someProggy.dll";
> > formData = new NVPair[] {new NVPair("name1", "value1"),new
> > NVPair("name2", "value2")};
> >
> > But where does "ThisGuy" go?


> GetMethod get = new
> GetMethod("http://some.domain.com/somePath/someProggy.dll?ThisGuy&name1=value1&name2=value2") ;
>
> and than do something like that
>
> HttpClient client=new HttpClient();
> client.executeMethod(get);
>


jock, Thanks for the advice, but I think I must be using an old
version or something. I didn't go into it, but I create an
HTTPConnection with a domain and port, then call the Get method with a
page and formData. The documentation doesn't say anything about
"GetMethod" or "executeMethod". The version I have came with a GNU
license dated 1999 and "Copyright (c) 1996-2001 Ronald Tschalär"-
maybe there's an update?
 
Reply With Quote
 
Dale
Guest
Posts: n/a
 
      11-11-2003
I found the latest version at
http://jakarta.apache.org/commons/ht...downloads.html

As usual with these things, the old usable version has been picked-up
and changed to such an extent that my old code won't run with the new
stuff (even if I could figure out exactly what to download,
dependencies and all). I noticed that NVPair is gone. So, one day
when I have plenty of time, I'll think about switching over (sigh).

--Dale--
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert url with query string to url without query string nick Javascript 1 02-13-2011 11:20 PM
Axis 1.x: WSDL2Java: specifying a new endpoint URL bruce_phipps@my-deja.com Java 0 11-23-2006 10:29 AM
Axis 1.x: WSDL2Java: specifying a new endpoint URL bruce_phipps@my-deja.com Java 0 11-23-2006 10:28 AM
specifying a query string in an href dynamically Robert Rotstein ASP .Net 1 11-25-2005 03:41 AM
Help me in Specifying Connection string to SQL server 2000 running on remote machine vighnesh ASP .Net 1 09-29-2005 09:05 AM



Advertisments