1

I try to use HttpURLConnection to read shoutcast metadata. Some shoutcast server retry non-HTTP header:

qty:~ qrtt1$ curl 'http://72.13.86.203:8000/'
ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/win32 v1.9.8<BR>
icy-name:VCY America - Teaching, Talk, and Sacred Music
icy-genre:Christian Sacred Talk
icy-url:http://www.vcyamerica.org
content-type:audio/mpeg
icy-pub:1
icy-br:64

The first line is ICY 200 OK, so HttpURLConnection don't parse it and no HTTP 200 OK will become the parse error. Is any way to customize HttpURLConnection ?

If it is impossible, I will write the code from Socket.

qrtt1
  • 7,746
  • 8
  • 42
  • 62
  • Look at the class hierarchy. HttpURLConnection inherits from an abstract URLConnection. You may be able to extend URLConnection to do what you need. – Jim Garrison Oct 23 '13 at 03:44
  • I have been using HttpURLConnection always to connect to SHOUTcast streams. However, after Android 4.4 this doesn't seem to work. I have posted a question about this issue here: http://stackoverflow.com/questions/19738798/android-4-4-http-api-bugs – Jona Nov 02 '13 at 04:04

0 Answers0