DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

How I can check that data is proper application/x-www-form-urlencoded data?

As I ask upon here:

I am trying to check if post data is a proper form www-urlencoded using nodejs:

const connect = require('connect')
const { request } = require('node:http');


const app = connect();

/**
 * Check if valis url encoded.
 * For now I set the value as true
 * @param {String} body 
 *

I try to check that request data are in a valid form as content-type application/x-www-form-urlencoded is expected to be.

I do not want to use any 3rd party libraries but to make a small middleware in order to do any checks.

Can u help me?

Top comments (0)