I want to receive JPEG images from an IP-camera over HTTP. I am using LIBCURL for this purpose in my C program. The camera returns a single image with the following URL:

```
"http://143.205.116.14?image&res=full&x0=0&y0=0&x1=2944&y1=1920"

```

Using LIBCURL, I can receive a single image and write it to a .jpg file in the callback function. However, for continuous streaming, the camera accepts a GET request as follows:

```
"GET /mjpeg&res=full&x0=0&y0=0&x1=2944&y1=1920 HTTP/1.1\r\n HOST:143.205.16.14\r\n\r\n"

```

I was wondering how do I specify this GET request in libcurl. Is it possible to use in curl\_easy\_setopt()? 

At present I use the following code to get a single image and save in the write\_data callback function:

```
size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) {
    size_t written;
    written = fwrite(ptr, size, nmemb, stream);
    return written;
}

int main()
{
        curl = curl_easy_init();
    if(curl) {
    fp = fopen("C:\\trans.txt","wb");
    curl_easy_setopt(curl, CURLOPT_URL, "http://143.205.116.14?image&res=full&x0=0&y0=0&x1=2944&y1=1920");
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); 
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
    res = curl_easy_perform(curl);
    curl_easy_cleanup(curl);
    fclose(fp);
    }

```

How do I use the GET method so that the images are received continuously and saved by the callback function?