public IHttpActionResult Get(string ipAddress) { try { CameraModel camera = new CameraModel(); camera.cameraIpAddress = ipAddress; return Ok(camera); } catch { return InternalServerError(); } }
public HttpResponseMessage Get(string ipAddress) { try { CameraModel camera = new CameraModel(); camera.cameraIpAddress = ipAddress; CameraFinder finder = new CameraFinder(camera); finder.GetImage(); var result = new HttpResponseMessage(HttpStatusCode.OK); result.Content = new ByteArrayContent(finder.ImageBytes); result.Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg"); return result; } catch { return new HttpResponseMessage(HttpStatusCode.InternalServerError); } }
public ImageExtractor(CameraModel camera) { this.username = camera.username; this.password = camera.password; this.url = camera.mpegUrl; }
public CameraFinder(CameraModel cameraInfo) { this.cameraInfo = cameraInfo; }