Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretty print option to display message selected by id #196

Open
cmoulliard opened this issue Sep 29, 2017 · 3 comments
Open

Pretty print option to display message selected by id #196

cmoulliard opened this issue Sep 29, 2017 · 3 comments

Comments

@cmoulliard
Copy link

cmoulliard commented Sep 29, 2017

Is there a pretty print option to display JSON message selected by id

Request

http get https://apps.fedoraproject.org/datagrepper/id id==2017-541fe9b0-ddee-4dac-b77d-e32748c30f1e is_raw==true size==extra-large

Response

HTTP/1.1 200 OK
AppServer: proxy12.fedoraproject.org
AppTime: D=171917
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 2544
Content-Type: */*
Date: Fri, 29 Sep 2017 17:05:11 GMT
Keep-Alive: timeout=15, max=500
Server: Apache/2.4.6 (Red Hat Enterprise Linux) mod_wsgi/3.4 Python/2.7.5
Strict-Transport-Security: max-age=15768000; includeSubDomains; preload
Vary: Accept-Encoding

{"certificate":"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUViakNDQTllZ0F3SUJBZ0lDQWJNd0RRWUpL\nb1pJaHZjTkFRRUZCUUF3Z2FBeEN6QUpCZ05WQkFZVEFsVlQKTVFzd0NRWURWUVFJRXdKT1F6RVFN\nQTRHQTFVRUJ4TUhVbUZzWldsbmFERVhNQlVHQTFVRUNoTU9SbVZrYjNKaApJRkJ5YjJwbFkzUXhE\nekFOQmdOVkJBc1RCbVpsWkcxelp6RVBNQTBHQTFVRUF4TUdabVZrYlhObk1ROHdEUVlEClZRUXBF\nd1ptWldSdGMyY3hKakFrQmdrcWhraUc5dzBCQ1FFV0YyRmtiV2x1UUdabFpHOXlZWEJ5YjJwbFkz\nUXUKYjNKbk1CNFhEVEUwTURZeE5qRTJOVFV3T0ZvWERUSTBNRFl4TXpFMk5UVXdPRm93Z2Z3eEN6\n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6RUxNQWtHQTFVRUNCTUNUa014RURBTwpCZ05WQkFj\nVEIxSmhiR1ZwWjJneEZ6QVZCZ05WQkFvVERrWmxaRzl5WVNCUWNtOXFaV04wTVE4d0RRWURWUVFM\nCkV3Wm1aV1J0YzJjeER6QU5CZ05WQkFNVEJtWmxaRzF6WnpFUE1BMEdBMVVFS1JNR1ptVmtiWE5u\nTVNZd0pBWUoKS29aSWh2Y05BUWtCRmhkaFpHMXBia0JtWldSdmNtRndjbTlxWldOMExtOXlaNElK\nQU9OUUhrZFBGeDVGTUJNRwpBMVVkSlFRTU1Bb0dDQ3NHQVFVRkJ3TUNNQXNHQTFVZER3UUVBd0lI\nZ0RBTkJna3Foa2lHOXcwQkFRVUZBQU9CCmdRQTA1ODY5NFNMcFBXbEc2WUxiWDhFOEd3cGlPM1c3\nemZNMGFUMENVNnA4QmxMajhTdWRjdnVZRlQ1MURmZnEKZHdkWkt6MklUWU43Vi9kcEtjR05RSElv\ndGUzL1EySThXeGgyMG1tM09lV1B5amdmZVRwOStsTWtGNEI3eXR0UApoaDgzZXl2RHk1akQ1SnEr\ncDVXSDMwWC9oVTI4SytjWllDUlJOQkJKZDNWamZ3PT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0t\nLQo=\n",
"crypto":"x509","headers":{},"i":52,"msg":{"after":"b7c43a292564df202304b16263814174d2f0265b","base_ref":null,"before":"35d29518c69c8822b00f693316dffbfca9680e63","commits":[{"added":[],"author":{"email":"[email protected]","name":"Charles Moulliard","username":"cmoulliard"},"committer":{"email":"[email protected]","name":"GitHub","username":"web-flow"},"distinct":true,"id":"b7c43a292564df202304b16263814174d2f0265b","message":"Update README.md","modified":["README.md"],"removed":[],"timestamp":"2017-09-29T17:16:52+02:00","tree_id":"5d3f5c3ccc593b578ad75e1b73541d92baeb85a7","url":"https://github.com/cmoulliard/spring-boot-bom/commit/b7c43a292564df202304b16263814174d2f0265b"}],"compare":"https://github.com/cmoulliard/spring-boot-bom/compare/35d29518c69c...b7c43a292564","created":false,"deleted":false,"fas_usernames":{"cmoulliard":"cmoulliard"},"forced":false,"head_commit":{"added":[],"author":{"email":"[email protected]","name":"Charles Moulliard","username":"cmoulliard"},"committer":{"email":"[email protected]","name":"GitHub","username":"web-flow"},"distinct":true,"id":"b7c43a292564df202304b16263814174d2f0265b","message":"Update README.md","modified":["README.md"],"removed":[],"timestamp":"2017-09-29T17:16:52+02:00","tree_id":"5d3f5c3ccc593b578ad75e1b73541d92baeb85a7","url":"https://github.com/cmoulliard/spring-boot-bom/commit/b7c43a292564df202304b16263814174d2f0265b"},"pusher":{"email":"[email protected]","name":"cmoulliard"},"ref":"refs/heads/master","repository":{"created_at":1506688210,"default_branch":"master","description":null,"fork":true,"forks":0,"forks_count":0,"full_name":"cmoulliard/spring-boot-bom","has_downloads":true,"has_issues":false,"has_pages":false,"has_projects":true,"has_wiki":true,"homepage":null,"html_url":"https://github.com/cmoulliard/spring-boot-bom","id":105269867,"language":null,"master_branch":"master","name":"spring-boot-bom","open_issues":0,"open_issues_count":0,"owner":{"email":"[email protected]","gravatar_id":"","html_url":"https://github.com/cmoulliard","id":463790,"login":"cmoulliard","name":"cmoulliard","site_admin":false,"type":"User","url":"https://api.github.com/users/cmoulliard"},"private":false,"pushed_at":1506698231,"size":66,"stargazers":0,"stargazers_count":0,"updated_at":"2017-09-29T12:31:26Z","url":"https://github.com/cmoulliard/spring-boot-bom","watchers":0,"watchers_count":0},"sender":{"gravatar_id":"","html_url":"https://github.com/cmoulliard","id":463790,"login":"cmoulliard","site_admin":false,"type":"User","url":"https://api.github.com/users/cmoulliard"}},"msg_id":"2017-541fe9b0-ddee-4dac-b77d-e32748c30f1e","signature":"Z6nDUBEAimzJYt7fI9hyf/M+V5O/QL042dPnuIiY64eZRsVun6QJZ7Mx0idFSikVajAUAE7Isha/\n7KWGHgjOSWK0SRNY9LgeON+5belQg40oNTidia6Pd3OaDN1lIsZeTdUVrVcJZ7sIU1Ym6Nmsu40d\nRclUY8knLT9wiVTIEFw=\n","source_name":"datanommer","source_version":"0.8.1","timestamp":1506698232.0,"topic":"org.fedoraproject.prod.github.push","username":"apache"}
@pypingou
Copy link
Member

Set the content-type to html rather than json, or access the page in a browser: https://apps.fedoraproject.org/datagrepper/id?id=2017-541fe9b0-ddee-4dac-b77d-e32748c30f1e&is_raw=true&size=extra-large

@cmoulliard
Copy link
Author

Even if I set the Content-Type to hext/html, the result isn't formatted correctly

http get https://apps.fedoraproject.org/datagrepper/id id==2017-541fe9b0-ddee-4dac-b77d-e32748c30f1e is_raw==false size==medium Content-Type:text/html

@pypingou
Copy link
Member

pypingou commented Oct 2, 2017

Turns out it's the Accept header that makes it return html but that won't quite do what you want.

This being an API meant to be used by tool, I do not think there is a way to do what you're asking :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants