We need to separate the 'base URL' and the service endpoint, when creating new pipes / a new pipeline...
/**
* A factory method to instantiate the AGPipeline, which
* contains a RESTful pipe.
*
* @param name the name of the first AGPipe object
* @param baseURL the URL of the server
* @param endpoint the serivce endpoint, if differs from the pipe name.
*
* @return the AGPipeline object
*/
+(id) pipelineWithPipe:(NSString*) name baseURL:(NSURL*)baseURL endpoint:(NSString*)endpoint;
(Note: currently the NSURL type is named 'url', that will be changed to 'baseURL')
NSURL* serverURL = [NSURL URLWithString:@"http://todo-aerogear.rhcloud.com/todo-server/"];
AGPipeline* pipeline = [AGPipeline pipelineWithPipe:@"bad name" baseURL:serverURL endpoint:@"projects"]
// get the pipe object for the 'projects' endpoint:
id<AGPipe> myPipe = [pipeline get@"bad name"];
NSString* url = [myPipe url];
The 'url' is than equivalent to "http://todo-aerogear.rhcloud.com/todo-server/projects/"....