cURL / Mailing Lists / curl-library / Single Mail

curl-library

(no subject)

From: Jeff Pohlmeyer <yetanothergeek_at_yahoo.com>
Date: Tue, 19 Aug 2003 20:58:38 -0700 (PDT)

> I am accessing streaming audio on: http://64.236.34.141:80/stream/1019
>
> With libcurl 7.10.3, my HTTP header parsing routine returns:
>
> HTTP/1.1 200 OK
> Date: Thu, 14 Aug 2003 16:10:55 GMT
> Connection: close
> Via: 1.0 shkcah02 (NetCache NetApp/5.1R2D16)
>
> With the command line version of 7.10.3, I get the following:
>
> ICY 200 OK
> icy-genre: Modern Jazz
> icy-url: http://www.di.fm

Not sure why your headers are different,
but you might try something like this:

#include <stdio.h>
#include <curl/curl.h>

int main(void){
  CURL *curl;
  struct curl_slist* alias = NULL;
  CURLcode ret;
  FILE *f;

  curl = curl_easy_init();
  curl_easy_setopt(curl, CURLOPT_URL, "http://64.236.34.141:80/stream/1019");

  alias = curl_slist_append(alias, "ICY 200 OK");
  curl_easy_setopt(curl, CURLOPT_HTTP200ALIASES, alias);

  curl_easy_setopt(curl, CURLOPT_USERAGENT, "winamp");

  curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);

  curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
  f = fopen("out.dat", "wb");
  curl_easy_setopt(curl, CURLOPT_FILE, f);
  ret = curl_easy_perform(curl);
  fclose(f);
  curl_easy_cleanup(curl);
  return ret;
}

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code=104
Received on 2003-08-20