Re: [Mojolicious] Handling different types of JSON requests

2016-10-04 Thread Myf White
Thanks Jan, I only just got around to looking up JSON::Validator... Nice! I think this will suit my needs for this project better than Mojolicious::Plugin::OpenAPI. Kind Regards, Myf White *Phone: *0413 757 052 *Email:* myfwh...@gmail.com On Wed, Sep 28, 2016 at 10:21 PM, Jan Henning Thorsen <

Re: [Mojolicious] Handling different types of JSON requests

2016-09-28 Thread Jan Henning Thorsen
If you think M::P::OpenAPI is too much, then you can use JSON::Validator instead. Check out these links: https://metacpan.org/pod/JSON::Validator#SYNOPSIS https://metacpan.org/source/JHTHORSEN/JSON-Validator-0.85/t/validate-json.t On Sunday, September 25, 2016 at 9:47:54 AM UTC+2, myf wrote: >

Re: [Mojolicious] Handling different types of JSON requests

2016-09-25 Thread Myf White
Great. Thanks everyone. Kind Regards, Myf White *Phone: *0413 757 052 *Email:* myfwh...@gmail.com On Sun, Sep 25, 2016 at 8:45 AM, Daniel Mantovani wrote: > multipart/form-data also supports binary data natively (i.e. uploading > files). You could use Base64 to convert the binary data, but it

Re: [Mojolicious] Handling different types of JSON requests

2016-09-24 Thread Daniel Mantovani
multipart/form-data also supports binary data natively (i.e. uploading files). You could use Base64 to convert the binary data, but it depends whether the overheads (33% on network and corresponding processing load) may be a problem or not for your particular case. El sábado, 24 de septiembre d

Re: [Mojolicious] Handling different types of JSON requests

2016-09-24 Thread Joel Berger
For validation of JSON apis there are external modules like https://metacpan.org/pod/Mojolicious::Plugin::OpenAPI -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [Mojolicious] Handling different types of JSON requests

2016-09-24 Thread sri
> > The only benefit of multipart/form-data is that it's sent natively by HTML > forms so doesn't require javascript (or some other language) to construct > the request, but that's not really important for an API. > There's also the advantage that we have validation for forms, but not JSON.

Re: [Mojolicious] Handling different types of JSON requests

2016-09-24 Thread Myf White
Perfect. Thanks Dan. Kind Regards, Myf White *Email:* myfwh...@gmail.com On Sat, Sep 24, 2016 at 5:09 PM, Dan Book wrote: > JSON gives you the option to send more straightforward and possibly nested > hashes and arrays. JSON body is a relatively common method of making API > requests so there'

Re: [Mojolicious] Handling different types of JSON requests

2016-09-24 Thread Dan Book
JSON gives you the option to send more straightforward and possibly nested hashes and arrays. JSON body is a relatively common method of making API requests so there's no reason to avoid it really. The only benefit of multipart/form-data is that it's sent natively by HTML forms so doesn't require j

[Mojolicious] Handling different types of JSON requests

2016-09-23 Thread Myf White
I'm using a javascript library which has two ways of sending POST requests 1. using javascripts FormData, content-type: multipart/form-data 2. or as JSON within the body, content-type: application/json >From the Mojolicious side they both work - I can get a parameter 'foo': 1. with $c->