httpcode icon indicating copy to clipboard operation
httpcode copied to clipboard

Use Accept header instead of User-Agent sniffing

Open motowilliams opened this issue 11 years ago • 1 comments

Even though curl and wget are the gold standard for this type of utility it would be super useful if we could also use an Accept header to get alternate content versions of these code and descriptions. This would make a little more of an API that could be used with other clients not listed in your command_line_agents block https://github.com/tternes/httpcode/blob/master/web/index.php#L39.

This could open the door for a json and xml responses and then maybe could enable a html response (think embedding a html fragment into another web application)

motowilliams avatar Feb 02 '14 16:02 motowilliams

Great idea.

IIRC, @dahlbyk had also mentioned this on Twitter at some point.

tternes avatar Feb 02 '14 18:02 tternes