Open AndreaCrotti opened 8 years ago
Abao doesn't currently support form-based submissions (a.k.a. application/x-www-form-urlencoded
),
only JSON-based media types.
As far as examples go, there are RAML/schema files in the test/fixtures
folder.
Sorry. I wrote response yesterday, but left without posting it.
Ah ok thanks no problem @plroebuck I'll close the issue, is it a feature you want to implement anyway?
@AndreaCrotti Abao support for url-encoded form data is something I hope to see added eventually as well, and I will contribute to that feature if I can. However I think in your case the problem is with the way you defined your specification. The data in your request example is clearly JSON, so I would recommend changing your specification to use a content-type of application/json:
/abao-check/:
post:
body:
application/json:
example: |
{"email": "email@mail.com"}
If that endpoint actually does accept a url-encoded form with an "email" field, putting JSON as the example for the request body is confusing. This tutorial on raml.org gives an example of how to document a form (using formParameters directive). http://raml.org/developers/raml-200-tutorial#body-parameters
This is still an open issue right @coltonlw ?
@AndreaCrotti I believe so, we are using Postman collections run via newman CLI runner for postman to test url encoded or multipart form data and file uploads
I'm trying to test a simple API that takes an email in the POST data and return something else. So I defined my raml file like this:
but no matter what I do it doesn't seem it's never putting any body in request.POST. Any idea why?
Am I missing something obvious? by the way I think it would be great to have some examples of RAML files to test in this project, would make it easy to see what it can be done.. Thanks a lot!