You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per my understanding bruno uses axios underneath as the http client library
so need help on how to use the below axios code in bruno for streaming the response
Axios is not a built in library and must be installed externally.
You can create a package.json at the root of your collection and do npm i axios
Then inside scripting you can require axios like const axios = require('axios') inside your script. Infact, you can use any npm module of your like this.
console.log will not currently work, as it is executed in the node process. Will be building functionality to make logs visible in app.
With the streaming stuff, are you trying to write some test scripts that can be run and write tests to validate your streams response data ?
Bruno now supports both node-fetch and axios npm packages by default.
We also recently implemented support for making synchronous requests work as a part of #138
Here is a sample axios code to await a synchronous request.
Hi ,
As per my understanding bruno uses axios underneath as the http client library
so need help on how to use the below axios code in bruno for streaming the response
const response = await axios.get(
https://stream.example.com
, {headers: {Authorization:
Bearer ${token}
},responseType: 'stream'
});
How to port this to bruno?
const stream = response.data
stream.on('data', data => {
data = data.toString()
console.log(data)
})
went through the docs here https://docs.usebruno.com/scripting/
So axios will be like an in-built library or an external library?
The text was updated successfully, but these errors were encountered: