Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

149
Vistas
POST Binary Buffer to Express Backend that uses Body-Parser as middleware gives an empty Body

I'm sending data from Client to the Backend in 2 forms: both encrypted and non encrypted.

I'm using this Express code:

const express = require('express');
const app = express();

// adding Middlewares ....    

app.use(express.urlencoded({ extended: true, limit: '100mb', parameterLimit: 100000000 }));
app.use(express.json({ limit: '100mb'}));

When I POST a non encrypted body , something as:

method: 'POST',
uri: ** BACKEND-ENDPOINT ** ,
headers: {
    'Content-type': 'application/json',   
    'yourAPIToken': // big token
},  
json: true,
body: 'Some binary data goes here'

The request reaches the Backend and the body is accepted as sent.

However when using Encrypted data , doing something as follows:

const aesjs = require('aes-js');

let encryptedData;

// manipulating data with "aesjs" into "encryptedData"

const dataToSend = Buffer.from(encryptedData, 'binary');

And POSTing this using:

method: 'POST',
uri: ** BACKEND-ENDPOINT ** ,
headers: {
    'Content-type': 'application/json',   
    'yourAPIToken': // big token
},  
json: true,
body: dataToSend

This POST request is accepted in the Backend with empty body , as follows: {}.

Why when I send the data encrypted the Body-Parser of Middleware doesn't work , and how can we fix the Body from being empty ?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda