Hi,Today when we set up a Pipe and call methods on it, we have a different ways on how we can pass the stuff which are part of the URI and more particularly the leading or ending "/" :```baseURL: "http://www.slackers.com" //no ending slashendpoint: "/security" //we have to start with a slash```But we can also do it the otherr way around :```baseURL: "http://www.slackers.com/" //ending slashendpoint: "security" //no starting slash```Both are valid because our library (at least JavaScript) don't do any manipulation for ```baseURL``` and ```endpoint```.But if you take the parameter ```id``` on the ```read``` function, this one must not have a leading "/" because it's added by the library:```id: "team1" //worksid: "/team" //fails
```Until now ```id``` was the last part of the URI but since we are planning to add nested resources, ```id``` won't be necessarily the last fragment. For example, we could have a new parameter called ```resource``` to be appended at the end :```baseURL = "http://www.slackers.com/" //ending slashendpoint: "security" // no starting slashid: "5" // handled by libresource: "/crypto" //leading slash needed```As the spirit of Pipes (at least for REST) is to offer an abstraction around the Ajax and URL handling plumbing code, I think we should have a convention for passing URI fragments that is the same for all. My suggestion is to do the same as for ```id``` : no leading ``` / ``` or ending ``` / ```.
NSURL *url = [NSURL URLWithString:@"http://server.com/security"];
url = [url URLByAppendingPathComponent:@"/foo/bar"];
===> http://server.com/security/foo/bar
If the user passes a leading or ending ``` / ```, the library will removed it because it will be added implicitly. This way we are safe.Remarks ? Questions ?Seb
_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev