title: Objective-C/CocoaHTTPServer - Return an image how response
body: <p>I have this simple method that check if i pass a parameter like "/testPhoto", and if, it is passed, i want try to answer with a simple image that has the path that you can see in the variable "testPath" (static path for try). At the moment, when i do the request, i receive the 200 ok status from the server, but no data is passed (0 Bytes). I need to understand what i'm doing wrong. Maybe the testPath doesn't contains a correct path? The path that i'm using is found using the ALAssetslibrary.</p>
  
  <pre><code>- (NSObject&lt;HTTPResponse&gt; *)httpResponseForMethod:(NSString *)method URI:(NSString *)path{
  
    HTTPLogTrace();
  
    if ([path isEqualToString:@"/testPhoto"]){
      NSString *testPath = [[NSString alloc] init];
      testPath = @"assets-library://asset/asset.JPG?id=DB96E240-8760-4FD6-B8B4-FEF3F61793B3&amp;ext=JPG";
      NSURL *deviceImageUrl = [[NSURL alloc] initWithString:testPath];
      NSData *imageData = [NSData dataWithContentsOfURL:deviceImageUrl];
      UIImage *deviceImage = [UIImage imageWithData:imageData];
  
      HTTPDataResponse *photoResponse = [[HTTPDataResponse alloc] initWithData:imageData];
      return photoResponse;
    }
  
  return nil;
  
  }
  </code></pre>
  
  <p>Thanks</p>