newbie: HTTP and URIs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm quite new to this, so please excuse trivial questions:

- Is there any function (int the .net framework) that gives me an
enumeration of all URIs in a http stream (passed as e.g. a string)? If not,
how could I achieve such a thing?

- Really trivial, but to make sure: What does the string "/..../" in an URL
mean? I'd suspect some directory operation, but I dunno exactly...

- I'm currently using the HttpUtility.UrlDecode() function to decode some
http URIs and one thing stroke me in particular: The string
[...]"test.exe?/c+xtsr" is decoded to "test.exe?/c xtsr", missing the "+".
When I use the System.Uri class for the decoding the "+" remains....Does
anyone know why?

Thanks for reading till end and thanks in advance

Peter
 
Hi Peter,

No question is trivial if you don't know the answer to it! :)
- Is there any function (int the .net framework) that gives me an
enumeration of all URIs in a http stream (passed as e.g. a string)? If
not,
how could I achieve such a thing?

Not sure what you mean by this. You can find URLs in an HTML document by
using Regular Expressions. The HTML document is a string.
- Really trivial, but to make sure: What does the string "/..../" in an
URL
mean? I'd suspect some directory operation, but I dunno exactly...

Is that the exact string you saw in a URL? I've never seen it before.

The following link to the W3C should help":

http://www.gbiv.com/protocols/uri/rfc/rfc3986.html
- I'm currently using the HttpUtility.UrlDecode() function to decode some
http URIs and one thing stroke me in particular: The string
[...]"test.exe?/c+xtsr" is decoded to "test.exe?/c xtsr", missing the "+".
When I use the System.Uri class for the decoding the "+" remains....Does
anyone know why?

The "+" character is a URL-Encoding for a space (which is an illegal URL
character).

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

Peter Schmitz said:
Hi,

I'm quite new to this, so please excuse trivial questions:

- Is there any function (int the .net framework) that gives me an
enumeration of all URIs in a http stream (passed as e.g. a string)? If
not,
how could I achieve such a thing?

- Really trivial, but to make sure: What does the string "/..../" in an
URL
mean? I'd suspect some directory operation, but I dunno exactly...

- I'm currently using the HttpUtility.UrlDecode() function to decode some
http URIs and one thing stroke me in particular: The string
[...]"test.exe?/c+xtsr" is decoded to "test.exe?/c xtsr", missing the "+".
When I use the System.Uri class for the decoding the "+" remains....Does
anyone know why?

Thanks for reading till end and thanks in advance

Peter
 
Thanks for replying!
Not sure what you mean by this. You can find URLs in an HTML document by
using Regular Expressions. The HTML document is a string.

What are Regular Expressions? The main thing I want to achieve is to write a
network sniffer that receives all http traffic, then gets all the URIs that
are included in the network flow. that's why I need to be prepared for
misled/-configured html traffic - or even malicious traffic. The string
"/..../" belongs to the malicious party (causes some 'directory transversal'
on the web server, dunno...).
Is "+" the only replacement for " " in html - or are there other possiblities?

Thanks a lot
Peter

Kevin Spencer said:
Hi Peter,

No question is trivial if you don't know the answer to it! :)
- Is there any function (int the .net framework) that gives me an
enumeration of all URIs in a http stream (passed as e.g. a string)? If
not,
how could I achieve such a thing?

Not sure what you mean by this. You can find URLs in an HTML document by
using Regular Expressions. The HTML document is a string.
- Really trivial, but to make sure: What does the string "/..../" in an
URL
mean? I'd suspect some directory operation, but I dunno exactly...

Is that the exact string you saw in a URL? I've never seen it before.

The following link to the W3C should help":

http://www.gbiv.com/protocols/uri/rfc/rfc3986.html
- I'm currently using the HttpUtility.UrlDecode() function to decode some
http URIs and one thing stroke me in particular: The string
[...]"test.exe?/c+xtsr" is decoded to "test.exe?/c xtsr", missing the "+".
When I use the System.Uri class for the decoding the "+" remains....Does
anyone know why?

The "+" character is a URL-Encoding for a space (which is an illegal URL
character).

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

Peter Schmitz said:
Hi,

I'm quite new to this, so please excuse trivial questions:

- Is there any function (int the .net framework) that gives me an
enumeration of all URIs in a http stream (passed as e.g. a string)? If
not,
how could I achieve such a thing?

- Really trivial, but to make sure: What does the string "/..../" in an
URL
mean? I'd suspect some directory operation, but I dunno exactly...

- I'm currently using the HttpUtility.UrlDecode() function to decode some
http URIs and one thing stroke me in particular: The string
[...]"test.exe?/c+xtsr" is decoded to "test.exe?/c xtsr", missing the "+".
When I use the System.Uri class for the decoding the "+" remains....Does
anyone know why?

Thanks for reading till end and thanks in advance

Peter
 
Back
Top