Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fernandovalente

macrumors 6502
Original poster
I'm creating an application in Objective-C and I need to get the metadata from a SHOUTcast stream. I tried this:

NSURL *URL = [NSURL URLWithString😡"http://202.4.100.2:8000/"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
[request addValue😡"close" forHTTPHeaderField😡"CONNECTION"];
[request addValue😡"accept" forHTTPHeaderField😡"*/*"];
[request addValue😡"1" forHTTPHeaderField😡"Icy-MetaData"];
[request addValue😡"RadioToolX/1.0 (Macintosh; Intel)" forHTTPHeaderField😡"user-agent"];

I would have to get the headers from this request in order to get the information, right? Unfortunately it keeps returning these headers:

Date = "25 Apr 2010 23:05:29 -0200";
"Max-Age" = 0;

What I'm doing wrong?
 
Code:
NSURL *URL = [NSURL URLWithString:@"http://202.4.100.2:8000/"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
[request addValue:@"close" forHTTPHeaderField:@"CONNECTION"];
	[COLOR="Red"][request addValue:@"accept" forHTTPHeaderField:@"*/*"];[/COLOR]
	[request addValue:@"1" forHTTPHeaderField:@"Icy-MetaData"];
	[request addValue:@"RadioToolX/1.0 (Macintosh; Intel)" forHTTPHeaderField:@"user-agent"];

The red-hilited code looks wrong. I'm unaware of any HTTP header whose name is "*/*".

And if you're looking for Shoutcast metadata, then I'm pretty sure you'd have to get that from the server's reply, not the client's request.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.