<div dir="ltr"><br><div style><div>Hi,</div><div><br></div><div>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 "/" :</div>
<div><br></div><div>```</div><div>baseURL: "<a href="http://www.slackers.com">http://www.slackers.com</a>" //no ending slash </div><div>endpoint: "/security" //we have to start with a slash</div><div>```</div>
<div>But we can also do it the otherr way around :</div><div><br></div><div>```</div><div>baseURL: "<a href="http://www.slackers.com/">http://www.slackers.com/</a>" //ending slash </div><div>endpoint: "security" //no starting slash</div>
<div>```</div><div><br></div><div>Both are valid because our library (at least JavaScript) don't do any manipulation for ```baseURL``` and ```endpoint```.</div><div><br></div><div>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:</div>
<div>```</div><div>id: "team1" //works</div><div>id: "/team" //fails</div><div>```</div><div>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 :</div>
<div><br></div><div>```</div><div>baseURL = "<a href="http://www.slackers.com/">http://www.slackers.com/</a>" //ending slash </div><div>endpoint: "security" // no starting slash</div><div>id: "5" // handled by lib</div>
<div>resource: "/crypto" //leading slash needed</div><div>```</div><div>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 ``` / ```.</div>
<div><br></div><div>If the user passes a leading or ending ``` / ```, the library will removed it because it will be added implicitly. This way we are safe.</div><div><br></div><div>Remarks ? Questions ? </div><div> </div>
<div><br></div><div style> Seb</div><div style><br></div></div></div>