Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

base64 PayloadTooLargeError: request entity too large

// SERVER:
const bodyParser = require('body-parser')

var jsonParser = bodyParser.json({limit:1024*1024*10, type:'application/json'}); 
var urlencodedParser = bodyParser.urlencoded({ extended:true,limit:1024*1024*10,type:'application/x-www-form-urlencoded' });

app.use(jsonParser);
app.use(urlencodedParser);

//external:
app.use(bodyParser.urlencoded({extended: true}));
app.use(express.json());

//----------------------------------------------------------------------------

// AXIOS:

const request_config = {
  headers: {
   "Content-Type": "application/x-www-form-urlencoded"
  },
  data: buffer
 };
axios.post("http://localhost:4000/api/speech", request_config)

Source by github.com #
 
PREVIOUS NEXT
Tagged: #request #entity #large
ADD COMMENT
Topic
Name
5+5 =