>
> Hi,
>
>             I am writing this mail to clear about my approach of solving
> patch 1. I had made changes in the 'raw' function so that it returns the
> actual content except if content-type is html. Earlier, I was doing it
> using request_wants_json function (/datagrepper/util.py) but it matches for
> header type of either application/json or text/html only. In that case, if
> header type other than these two it returns value error. I came to know
> that there are 17 mimetypes  through this link<https://github.com/nicolaiarocci/flask-mimerender/blob/master/src/flaskmimerender.py>.
> And yeah, request_wants_json is also working. I tried for different
> mimetype using curl -H accept:text/html http://localhost:5000/raw<http://localhost:5000/raw.> by
> changing the accept header.So, I'll have to add all these mimetypes in the
> best-match in request_wants_json function and then have to set their
> priority.
>

  To continue with above approach either we should add different mimetypes
so that it can handle the accept header or browser should provide some
mechanism where it asks from user about the content type.

>
> That is why, i adopted another approach i.e. first checking the header and
> content type and if it is other than text/html, it returns the actual
> content. (simple one if/else block).
>

-Charul


On Sun, Oct 27, 2013 at 2:43 AM, Pierre-Yves Chibon <
notifications@github.com> wrote:

> In datagrepper/app.py:
>
> > @@ -39,7 +39,7 @@
> >  import datanommer.models as dm
> >
> >  from datagrepper.dataquery import DataQuery
> > -from datagrepper.util import assemble_timerange
> > +from datagrepper.util import assemble_timerange, request_wants_json
>
> Ah sorry, I should have checked util.py, I thought request_wants_json was
> a new method while in fact it already exists.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/fedora-infra/datagrepper/pull/80/files#r7235914>
> .
>