Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Content-type header

#51

It would be nice to provide a complete RESTful compliant application using limonade-php by utilizing the Content-type in the request header to figure out what kind of view should be outputted.

IE.

dispatch_get('/',function() {

switch(content_type()) {
    case 'json':
        echo json(array()); 
        break;
    default:
        echo html('<div></div>');
        break;

}

});


Please ignore my first comment on this.

It turns out this is not feasible due to cross-browser inconsistencies with the http accept headers. I tried implementing this while respecting the q values of the headers, but it becomes impossible when IE and webkit are involved due to their ridiculous headers. (IE accepts application/msword over text/html).

Please delete this.

Reported by xangelo (at gmail) · March 31st, 2011 @ 06:12 PM

State: invalid
Milestone: none
Assigned to: Fabrice Luraine Fabrice Luraine

Activity

  1. xangelo (at gmail)
    xangelo (at gmail)

    Sorry, ignore this. Feature is present in request_method() and $_SERVER['REQUEST_METHOD']

    April 4th, 2011 @ 10:49 PM

  2. Fabrice Luraine
    Fabrice Luraine
    • State changed from new to invalid

    May 26th, 2011 @ 07:52 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.