Comments (6)
Yeah the format is correct. To make it easier to read, try a JSON formatted
extension, like this one:
https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en
Postman is quite popular:
https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en
Cheers.
On Friday, March 14, 2014, Scott Deeter [email protected] wrote:
I am working on getting an API going for my app and have managed to get an
endpoint successfully returning JSON. The problem is, it appears to be
serialized--all the line breaks and newlines have been stripped from it. Is
there a way to get it to output more-readable JSON?Reply to this email directly or view it on GitHubhttps://github.com//issues/12
.
Sent from my mobile device.
from reststop2.
I submitted the pull request #13 as an idea to have reststop2 output pretty out of the box. Maybe this could even be a setting, but I don't know how to handle settings for Meteor smart packages.
I based this on the way github's API prettifies JSON output with 2 space indentions.
See example: https://api.github.com/events
Thanks for considering the pull request.
from reststop2.
duh, I realized reststop2 already has some settings. I added 'pretty_json' as a new setting in the existing pull request.
from reststop2.
Thanks @shrop for the PR. Merged this in. Should make it in next release.
I've defaulted pretty_json
to false
. This is a bit of personal opinion, but I don't think results should be formatted for humans, since they're intended for machines. For the paranoid, formatting adds unnecessary data in the form of carriage returns and spaces to the response. I believe it burden should be on the human to make it readable, by using an extension (or now setting the config).
Cheers.
from reststop2.
Excellent! I defaulted it to false and forgot to push that up. I totally agree. Thanks!
from reststop2.
Fantastic! Thanks for sorting this out.
from reststop2.
Related Issues (20)
- RESTstop.apply donβt work HOT 3
- realtime live data using rest? HOT 2
- Raw Post Data HOT 4
- * not working for catch-all route HOT 6
- Request Entity Too Large HOT 2
- Get reststop2 ready for Meteor 0.8.x (blaze) HOT 2
- Unexpected error. HOT 8
- Get 'Unknown error' when returning array of results
- Allow app and package to depend on reststop2 HOT 2
- if(this.params.user.indexOf('@') == -1) { "message": "Cannot call method 'indexOf' of undefined" HOT 2
- Signup call for account creation HOT 5
- srp removed from Meteor 0.8.2 HOT 7
- just add content-type if none present HOT 1
- login with reststop2 HOT 6
- bcrypt login problem HOT 2
- how to send data from client with json? HOT 3
- Add support for pluggable authentication
- POST XMLHttpRequest Failed HOT 2
- Sending File HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reststop2.