Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!