uri

Can we use & in url ?

Can we use "&" in a url ? or should "and" be used? ...

Massive API/Framework mashup issue (oAuth, Facebook, Twitter, Code Igniter)

Hi all, I'm having (many, but for now,) one problem with a project I'm working on. It is a PHP project run on Code Igniter It is a Facebook app that wants to use oAuth Twitter authorization CodeIgniter by default clears the $_GET array because it uses the URI for controlling MVC stuff. You can turn this off to access the GET array, ...

Are colons allowed URIs?

I thought using colons in URIs was "illegal". Then I saw that vimeo.com is using URIs like http://www.vimeo.com/tag:sample. What do you feel about the usage of colons in URIs? How do I make my Apache server work with the "colon" syntax because now it's throwing the "Access forbidden!" error when there is a colon in the first segment o...

PHP absolute path to file URI

In order to refer to a local DTD when using PHP SimpleXML, I need to convert the absolute path into a file type URI. For example, convert /home/sitename/www/xml/example.dtd to file:///home/sitename/www/xml/example.dtd. In the example given, it is easy enough, since all that is required is to add the 'file' scheme in front of the path. ...

Authoritative position of duplicate HTTP GET query keys

I am having trouble on finding authoritative information about the behavior with HTTP GET query string duplicate fields, like http://example.com/page?field=foo&field=bar and in particular if the order is kept or not. Most web-oriented languages produce an array containing both foo and bar associated to a key "field", but I would ...

ASP.NET: URI handling

I'm writing a method which, let's say, given 1 and hello should return http://something.com/?something=1&hello=en. I could hack this together pretty easily, but what abstraction functionality does ASP.NET 3.5 provide for building URIs? I'd like something like: URI uri = new URI("~/Hello.aspx"); // E.g. ResolveUrl is used here uri....

Working with relative file paths in .Net

I have a C# project where I include some resources which I need to refer using the Uri-class. For this specific problem I have some shaders placed in a "Shaders" folder in the root of the project, but I've had this problem before with other files like images, etc. This far I've used the simple solution giving a fixed absolute path, and m...

encodeURIComponent for double quotes disappears on form action

Hi, I'm trying to pass a url like: my_url = 'http://somedomain.com/somepath/somepage?key="query"'; when someone clicks on a form. I tried using encodeURI and encodeURIComponent and even using alerts to see that I have either "query" or %22query%22 because I call something like document.my_form.action = my_url but when the browser hi...

Path part gets overwritten when merging two Uri

I need to combine two url's that both contain .Path info. I would like to use Uri to give me possibility to .TryCreate() so i can catch malformed url's. The problem that im facing is that the base uri path seems to be ignored when i merge the absolute and the relative uri: Uri absoluteUri= new Uri("http://hostname/path/", UriKind.Abs...

How to load data from HTTPPOST request in server side?

I have a WebInvoke method like this; [OperationContract] [WebInvoke( Method = "POST", UriTemplate = "/go", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml )] string go(string name); and I post the data like t...

Trouble with Codeigniter Routes involving a query

Hey SO, I'm having a little trouble with a CodeIgniter route when there is a query (stuff after the ?) in the URI. I know it is good practice to replace queries with routes in CI, but I'm importing in a premade messageboard that already does everything with queries. This is my route: $route['messageboard/:any'] = "messageboard/index"...

How to parse a URI like this in Java

I'm trying to parse the following URI : http://translate.google.com/#zh-CN|en|你 but got this error message : java.net.URISyntaxException: Illegal character in fragment at index 34: http://translate.google.com/#zh-CN|en|你 at java.net.URI$Parser.fail(URI.java:2809) at java.net.URI$Parser.checkChars(URI.java:2982) ...

Android: possible to attach a file to email without writing to SD?

My application stores data locally in the native SQLite db, and I want to allow users to export this data by emailing themself a .csv file. In order to do this I'm generating the .csv from the database and writing it to the SD card, then attaching it to an email: StringBuilder csv = generateFile(); writeFile(csv.toString(),"file.csv"); ...

How to modify front of URL in Silverlight Navigation app?

My Silverlight application, using the navigation framework, has very pretty endings to its URLs, due to use of the URI mapping it does. But the front end still looks nasty, like: http://server:port/SilverlightPage.aspx#/uri-mapped-portion How can I get the "SilverlightPage.aspx#" portion to look nicer, preferably removing the ".aspx#"...

How do I get the URI that threw a WebException?

I'm calling a method on a webservice and it is throwing a 403 Forbidden WebException... System.Net.WebException: The request failed with HTTP status 403: Forbidden. I've got this error logged but I'd really like to have the URI recorded in the log message so it is easy to determine which webservice is causing the problem. Is t...

Codeigniter URI and jquery/javascript

Hello, I have a method in codeigniter that looks like this, public function category() { //$this->output->enable_profiler(TRUE); //echo "Hello function called by ajax"; $table = $this->uri->segment(3); $content_id = $this->uri->segment(4); $data['content'] = $this->site_model->get_content($table, $content_id); $this->load...

Android - Change MediaPlayer URI

Hi there! I have the following working code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.player); videoView = (VideoView)this.findViewById(R.id.videoView); playVideo(); // video finish listener ...

Normalizing URI to make it work correctly with MakeRelativeUri

Dim x AS New URI("http://www.example.com/test//test.asp") Dim rel AS New URI("http://www.example.com/xxx/xxx.asp") Console.Writeline(x.MakeRelativeUri(rel).Tostring()) In here output is: ../../xxx/xxx.asp Which looks correct almost all web servers will process the two of the following as same request: http://www.example.com/test//t...

file: URIs and Slashes

An application I'm working on involves accessing files on network file shares, and we're using URIs to specify the files' locations. My understanding of the file: URI is that they should take the form of file://+path. In the case of a Windows network share, this path looks something like \\servername\dir\file, so the resultant URI beco...

standard for resolving a urn:uuid (and other)?

My application uses urn:uuid as URIs for entities. Of course, when I get, e.g. RDF information about a resource, the referred entities (subject or objects) will contain URIs in the urn:uuid schema. To fetch the representation of the new entity, possibly in a REST way, I need a "resolver", similar in some way to dx.doi.org for DOIs. Anoth...