mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-07 14:08:38 +00:00
--------- Co-authored-by: marcosadsj <marcosadsj@gmail.com> Co-authored-by: naman-bruno <naman@usebruno.com> Co-authored-by: sanish chirayath <sanish@usebruno.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: echo binary
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{echo-host}}
|
||||
body: binaryFile
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:binary-file {
|
||||
file: @file(bruno.png) @contentType(image/png)
|
||||
}
|
||||
@@ -19,6 +19,17 @@ router.post('/xml-raw', (req, res) => {
|
||||
return res.send(req.rawBody);
|
||||
});
|
||||
|
||||
router.post('/bin', (req, res) => {
|
||||
const rawBody = req.body;
|
||||
|
||||
if (!rawBody || rawBody.length === 0) {
|
||||
return res.status(400).send('No data received');
|
||||
}
|
||||
|
||||
res.set('Content-Type', req.headers['content-type'] || 'application/octet-stream');
|
||||
res.send(rawBody);
|
||||
});
|
||||
|
||||
router.get('/bom-json-test', (req, res) => {
|
||||
const jsonData = {
|
||||
message: 'Hello!',
|
||||
|
||||
@@ -10,6 +10,7 @@ const multipartRouter = require('./multipart');
|
||||
const app = new express();
|
||||
const port = process.env.PORT || 8080;
|
||||
|
||||
app.use(express.raw({type: '*/*', limit: '100mb'}));
|
||||
app.use(cors());
|
||||
app.use(xmlParser());
|
||||
app.use(bodyParser.text());
|
||||
|
||||
Reference in New Issue
Block a user