[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: 302



Sender: "Larry" <Larry_Ducie@xxxxxxxxxxx>

Hi James,

Now I haven't got much experience of HTTPAPI (I'm looking into replacing my
HTTP 1.0 client with this 1.1 client, so I've downloaded the software and
I've joined the list - not much more than that yet). However, I CAN tell you
that http://62.254.171.224/miaftr2/webservices/v1.0/Logon isn't a relative
URL. It's an absolute URL.


Basically, every URL is constructed in the following way:

<scheme>://<user>:<password>@<host>:<port>/<path>;<parameters>?<query>#<frag
>

This is used to retrieve resources on the web.


Here's an explanation of the terms above:

<scheme> http:// or ftp:// or news:// or mailto:// or many others. This is
essential in any URL. Notice how your mail client knows that these are
schemes? They should appear to you as a link.

<user> and <password> are self explanatory. Both can be omitted from some
schemes, and are usually omitted from most URLs in certain other schemes.
Have you ever needed to enter them to gain access to a web site?

<host> can be any value that can be resolved into a 32-bit network address.
This is uaually a domain name or an IP address. If you use a domain name
then your iSeries must either act as a DNS server or it must use a
registered DNS server. Alternatively, you can use the old host table. :-) 

<port> is the port you want to connect to on the server. If it is omitted
then the client must retrieve the default port number. Each scheme will have
a different default port number - 80 is used for http://. You can retrieve
the default port number using APIs on the iSeries.

<path> This specifies the location of the resource relative to the server's
root directory. This can be a path in the true sense - a file path, or it
can be a virtual path that maps to a true path (such as /cgi-bin/ maps to
the directory or library that contains your CGI program objects). If a path
is not specified then the server will navigate to the root directory and
search for an index page. If found, the page is displayed. If not, and the
directory is public, the server will simply display a list of the files in
the directory - akin to Windows Explorer. This is where you put your home
page - and you call it index.html.

<parameters> is used to pass parms to programs. You could easily do this
using <query> when using HTTP (or as content when posting), but you might
need to use <parameters> for some FTP applications. 

<query> is the query string that you can pass when using the GET method.

<frag> is a part of a resource that you want to position to. These are what
are used when you click on a link and simply jump down to another part of
the same page - you have jumped to another fragment. 


OK, that is how you construct an ABSOLUTE URL.

Now imagine that you are designing a web site: You would register a domain
name and assign an IP address to it. You would configure your server to run
on port 80. You would set up the root directory and place an index page in
it.

Now, this index page can be accessed with a URL of the form
http://yourdomain.com. There is no need to specify the port or path as
/index.html will be located automatically by the server.

On this page you would specify the locations of various other pages on your
website. The user would simply click the link to navigate there. Now here's
your problem - do you want to include the absolute paths for every link? It
may seem like a good idea, but you can't use those links on your development
machine because they poin to your production machine. This is where RELATIVE
URLs come in. Here you specify other resources RELATIVE to your current
position.

So, if you was at http://yourdomain.com/dir1/dir2/index.html and you clicked
on a link specifying the relative URL ./dir3/anotherpage.html then you would
actually go to http://yourdomain.com/dir1/dir2/dir3/anotherpage.html. Thus,
you have navigated back up to dir2, down to dir3, and then located
anotherpage.html within /dir1/dir2/dir3. For a relative URL to work you MUST
already have an absolute URL. After all the URL must be relative to
something. :-)

Finally, relative URL support is performed at the client side - when you
click on a relative URL the client re-constructs it as an absolute URL,
starting with the current absolute URL as the base. This is just like using
the cd command. You can even use . (dot) and .. (double dot) notation.

Not much help, just a quick guide - you can implement your own relative URL
support by caching the current position and writing a simple navigation
algorithm to generate the new URL.

Cheers

Larry Ducie           

-----Original Message-----
From: owner-ftpapi@xxxxxxxxxxxxx [mailto:owner-ftpapi@xxxxxxxxxxxxx] On
Behalf Of James Viney
Sent: 06 December 2004 15:56
To: 'ftpapi@xxxxxxxxxxxxx'
Subject: RE: 302


Sender: James Viney <James.Viney@xxxxxxxxxx>

Hi all,

I'm still getting problems!

The url I'm posting to is
http://62.254.171.224/miaftr2/webservices/v1.0/Logon  which I've been told
is a relative url, which I understand your API's do not support.  Is this
correct because it doesn't reflect in the error message I'm getting? I'm
still getting a 302 error and an rc of -1....unless I change the url I'm
posting to so that it uses port number 443, when I get a http error of 400.
I still don't know if I'm a million miles away or a whisker?!  Any ideas?

Thanks,

James




James Viney
Senior Analyst/Programmer
Fortis Insurance Ltd
Tel: 023 8031 3324

 -----Original Message-----
From: 	owner-ftpapi@xxxxxxxxxxxxx [mailto:owner-ftpapi@xxxxxxxxxxxxx]  On
Behalf Of Scott Klement
Sent:	02 December 2004 21:13
To:	ftpapi@xxxxxxxxxxxxx
Subject:	Re: 302

Sender: Scott Klement <klemscot@xxxxxxxxxxxx>


Hi Elbert,

> Can you post to an ip address?
>
> Don't you have to specify a form or application at the other end such 
> as http:198.168.1.1/servlet.pgm

I assumed that when he said 'post to an ip address' he actually meant that
he was sending a URL such as
   http://192.168.100.5/somewhere/something.pgm

If all he's specifying is '192.168.100.5' then HTTPAPI should give him an
error telling him that 'Relative URLs are not supported!' or something
similar to that.

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail to
majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail to
majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------