tagged [uri]

Check if a url is reachable - Help in optimizing a Class

Check if a url is reachable - Help in optimizing a Class net 4 and c#. I need a Class able to return a Bool value if an Uri (string) return [HTTP status codes 200](http://en.wikipedia.org/wiki/List_of...

11 Jun at 18:52

Uri constructor with dontEscape is obsolete, what is alternatieve?

Uri constructor with dontEscape is obsolete, what is alternatieve? My question is regarding passing an URL to HttpWebRequest without escaping, I searched the forums and internet, but I didn't find a g...

7 Dec at 08:6

Uri.AbsoluteUri vs. Uri.OriginalString

Uri.AbsoluteUri vs. Uri.OriginalString I recently became aware of the odd behavior of `Uri.ToString()` (namely, it unencodes some characters and therefore is primarily suitable for display purposes). ...

8 Mar at 18:39

best URL validation

best URL validation im using code as below to check for the URL validation: The result as below should show all as , but somehow it has its own pattern to validate the url: : google.com : [http://

23 May at 11:47

Combining two relative Uris

Combining two relative Uris I need to combine two relative Uris, e.g. `../mypath/` and `myimage.png` to create `../mypath/myimage.png`. They are not paths to files on disk so `Path.Combine` is not app...

8 Dec at 18:12

How to check that a uri string is valid

How to check that a uri string is valid How do you check that a uri string is valid (that you can feed it to the Uri constructor)? So far I only have the following but for obvious reasons I'd prefer a...

28 Mar at 09:24

How to specify a local file within html using the file: scheme?

How to specify a local file within html using the file: scheme? I'm loading a html file hosted on the OS X built in Apache server, within that file I am linking to another html file in the same direct...

22 May at 12:9

Base Uri without a trailing slash

Base Uri without a trailing slash If I create a `Uri` using the `UriBuilder` like this: then the `AbsoluteUri` of `rootUrl` always contain a trailing slash like this: What I would like, is to create a...

27 Oct at 05:50

Changing the port of the System.Uri

Changing the port of the System.Uri I have an `Uri` object which contains an address, something like `http://localhost:1000/blah/blah/blah`. I need to change the port number and leave all other parts ...

30 Nov at 15:48

I get a 400 bad request - invalid Url when the length of the request exceeds 320+ characters

I get a 400 bad request - invalid Url when the length of the request exceeds 320+ characters Not sure what could be the reason. Added the following in Web.config also. maxUrlLength="1024" maxQueryStri...

6 Nov at 11:4

Get just the domain name from a URL?

Get just the domain name from a URL? I am trying to extract just the domain name from a URL string. I almost have it... I am using URI I have a string.. my first thought was to use Regex but then i de...

17 Dec at 07:45

Physical, Relative, Absolute and other paths

Physical, Relative, Absolute and other paths I have a task to write an object that can receive a different type of paths/urls, and return what type of path/url it is. For example the path can be ...an...

1 Nov at 13:52

Getting the parent name of a URI/URL from absolute name C#

Getting the parent name of a URI/URL from absolute name C# Given an absolute URI/URL, I want to get a URI/URL which doesn't contain the leaf portion. For example: given [http://foo.com/bar/baz.html](h...

4 Feb at 06:3

Download data URL file

Download data URL file I'm playing with the idea of making a completely JavaScript-based zip/unzip utility that anyone can access from a browser. They can just drag their zip directly into the browser...

2 Apr at 06:12

what does this mean ? image/png;base64?

what does this mean ? image/png;base64? I don't know what we call this. but i found a image at google 404 ``` url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKsAAADVCAMAAAAfHvCaAAAAGFBMVEVYn%2BH%2...

3 Jun at 22:4

Use URI builder in Android or create URL with variables

Use URI builder in Android or create URL with variables I'm developing an Android app. I need to build a URI for my app to make an API request. Unless there's another way to put a variable in a URI, t...

21 Sep at 18:14

Get file extension or "HasExtension" type bool from Uri object C#

Get file extension or "HasExtension" type bool from Uri object C# Quick question: Can anyone think of a better way then RegEx or general text searching to work out whether a Uri object (not URL string...

31 Dec at 04:16

Is there a right way to build a URL?

Is there a right way to build a URL? In much of the code I work with there is horrible stuff like: or - even worse: Is there a rig

8 Nov at 23:9

ServiceStack URI encoding

ServiceStack URI encoding I'm using ServiceStack for a while now and I'm very happy with the functionality it provides. Already implemented serveral services with it and it works like a charm. Recentl...

24 Nov at 09:56

Uri.EscapeDataString() - Invalid URI: The Uri string is too long

Uri.EscapeDataString() - Invalid URI: The Uri string is too long I'm using compact framework/C# on windows mobile. In my application I am uploading data to the server by serializing objects and using ...

C# The provided URI scheme 'http' is invalid; expected 'https'

C# The provided URI scheme 'http' is invalid; expected 'https' I am getting this error while invoking a method of my web service, I dont know what to do anymore :s Here is the exception details: > {"T...

14 Feb at 13:35

servicestack pass forward slash in uri

servicestack pass forward slash in uri I'm using servicestack to build a web api serving some old data over the web. Unfortunately the data schema does not lend itself particularly well to the standar...

9 Sep at 17:48

Was FxCop wrong to tell me to use the .Net Uri class?

Was FxCop wrong to tell me to use the .Net Uri class? When getting a URL for something in an Amazon S3 bucket it can append a signature to the end to confirm that the user has permission to view the o...

21 Feb at 18:41

Registering an Application to a URI Scheme in windows 10

Registering an Application to a URI Scheme in windows 10 A few years back I developed a Silverlight Component called from within an ASP.net web app, that uses PInvoke to access a USB (Serial COM port)...

21 Sep at 11:57

Android: Getting a file URI from a content URI?

Android: Getting a file URI from a content URI? In my app the user is to select an audio file which the app then handles. The problem is that in order for the app to do what I want it to do with the a...

1 Nov at 22:22

How to URL encode a string in Ruby

How to URL encode a string in Ruby How do I `URI::encode` a string like: to get it in a format like: as per RFC 1738? Here's what I tried: ``` irb(main):123:0> URI::encode "\x12\x34\x56\x78\x9a\xbc\xd...

MonoTorrent magnet link download does not start

MonoTorrent magnet link download does not start I strongly believe that MonoTorrent library can do this, but it is probably due to the lack of documentation that I haven't been able to get it working....

23 May at 12:2

How to use "Share image using" sharing Intent to share images in android?

How to use "Share image using" sharing Intent to share images in android? I have an image galley app; in that app I placed all the images into the drawable-hdpi folder. I call images in my activity li...

12 Feb at 17:47

Path.Combine for URLs (part 2)

Path.Combine for URLs (part 2) For awhile now, I've been searching for a Path.Combine method that works on URLs. This is similiar to [Path.Combine for URLs?](https://stackoverflow.com/questions/372865...

23 May at 10:30

In WPF, how do I reference a font in a resource library in code behind?

In WPF, how do I reference a font in a resource library in code behind? I have an application that uses a separate library assembly for resources (but not a resource-only assembly with no code), and I...

9 May at 19:59

How to open a packaged file with WinRT

How to open a packaged file with WinRT I am trying to figure out how to port some .Net code that parsed an xml file to WinRT. So far, with the help of [The given System.Uri cannot be converted into a ...

23 May at 11:58

Is embedding background image data into CSS as Base64 good or bad practice?

Is embedding background image data into CSS as Base64 good or bad practice? I was looking at the source of a greasemonkey userscript and noticed the following in their css: ``` .even { background: #ff...

29 Nov at 12:21

How to create a Uri instance parsed with GenericUriParserOptions.DontCompressPath

How to create a Uri instance parsed with GenericUriParserOptions.DontCompressPath When the .NET `System.Uri` class parses strings it performs some normalization on the input, such as lower-casing the ...

25 Mar at 13:39

HttpWebRequest long URI workaround?

HttpWebRequest long URI workaround? I've encountered an issue with HttpWebRequest that if the URI is over 2048 characters long the request fails and returns a 404 error even though the server is perfe...

19 Oct at 10:41

Why is it that "No HTTP resource was found that matches the request URI" here?

Why is it that "No HTTP resource was found that matches the request URI" here? I have code in my controller like so: ...and I'm calling it via Postman like so: .