Skip to content

Can't see variables submitted via application/x-www-form-urlencoded #68

@SilentImp

Description

@SilentImp

I am keep getting
409 Conflict

{
"code": "InvalidArgument",
"message": "name (MISSING): Field is required, email (INVALID): Invalid email"
}

if I am sending data with

Content-Type: application/x-www-form-urlencoded


name=Anton&email=boogagoogle.co
import restify from 'restify';
import restifyValidation from 'node-restify-validation';
const server = restify.createServer();
server.use(restify.plugins.queryParser());
server.use(restify.plugins.bodyParser());
server.use(restifyValidation.validationPlugin());
server.post({
  url: '/',
  validation: {
    queries: {
      name: {
        isRequired: true,
      },
      email: {
        isEmail: true
      },
    },
  }}, async (req, res, next)=>{});

I have tried content instead of queries also.
What gone wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions