Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SilentImp opened this issue Aug 17, 2017 · 3 comments
Open

Comments

@SilentImp
Copy link

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?

@gchauvet
Copy link
Collaborator

What is your restify version ?

@knudsenjeremy
Copy link

Was there ever resolution or a workaround for this issue?

@gchauvet
Copy link
Collaborator

Hi,

Email is invalid. Try with [email protected] seems to be ok. Take a look in unit tests in this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants