masterzen / nginx-upload-progress-module

Nginx module implementing an upload progress system, that monitors RFC1867 POST uploads as they are transmitted to upstream servers.

Home Page:http://wiki.codemongers.com/NginxHttpUploadProgressModule

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why do you wrap json into object?

lexer opened this issue · comments

Why do you wrap json into object? What advantages does it provide?

It's just what the lighttpd version of the module was returning, so I decided to return the same, then we extended to support more formats (including xml, json, jsonp and anything you can imagine). It was also easier to consume in browsers back when I wrote the module.

Note that you can as easily let the module return pure JSON with the "upload_progress_json_output" or even JSONP.

Thank you. Now everything is clear to me.