Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@burstjs/http
Advanced tools
Generic HTTP client that is used as a network provider for @burst/core.
@burstjs/http
can be used with NodeJS or Web. Two formats are available
Install using npm:
npm install @burstjs/http
or using yarn:
yarn add @burstjs/http
import {HttpImpl} from '@burstjs/http'
try{
const client = new HttpImpl('https://jsonplaceholder.typicode.com/');
const response = client.get('/todos/1')
console.log(response)
}
catch(httpError){
console.error(httpError.message)
}
<script>
Each package is available as bundled standalone library using IIFE.
This way burstJS can be used also within <script>
-Tags.
This might be useful for Wordpress and/or other PHP applications.
Just import the package using the HTML <script>
tag.
<script src='https://cdn.jsdelivr.net/npm/@burstjs/http/dist/burstjs.http.min.js'></script>
const client = new b$http.HttpImpl('https://jsonplaceholder.typicode.com/');
client.get('/todos/1').then(console.log)
See more here:
@burstjs/http Online Documentation
HttpError class
Thrown on HTTP errors
Http Implementation of [[Http]] using https://github.com/axios/axios
You can use [[HttpClient]] as alias
Http Mocker Builder for easy to http testing
Example:
const mockedHttp = HttpMockBuilder .create() .onGetReply(200, {foo: 'get'}) .onPostThrowError(500, 'Post Error', {e: 'post'}) .onPutThrowError(404, 'Put Error', {e: 'put'}) .onDeleteThrowError(403, 'Delete Error', {e: 'delete'}) .build();
const response = await mockedHttp.get('/url');
await mockedHttp.post('/url/post', {faz: 'post'}); // will throw exception
Http Response
Returned by Http request
Alias for HttpImpl
HttpError class
Thrown on HTTP errors
Kind: inner class of http
Creates your Http client
Param | Description |
---|---|
baseURL | The baseUrl, i.e host url |
options | [optional] An options/configurations object applied to all requests The current implementation uses axios, so the options can be found here Axios Configuration |
Kind: static method of HttpImpl
Internal:
Param | Description |
---|---|
url | The url |
error | The returned error |
Http Implementation of [[Http]] using https://github.com/axios/axios
You can use [[HttpClient]] as alias
Kind: inner class of http
Creates your Http client
Param | Description |
---|---|
baseURL | The baseUrl, i.e host url |
options | [optional] An options/configurations object applied to all requests The current implementation uses axios, so the options can be found here Axios Configuration |
Kind: static method of HttpImpl
Internal:
Param | Description |
---|---|
url | The url |
error | The returned error |
Internal: Http Mocker for easy to http testing using Jest
When using this mocking helper you need to call Http.onGet()
before Http instance is created
Kind: inner class of http
Creates your Http client
Param | Description |
---|---|
baseURL | The baseUrl, i.e host url |
options | [optional] An options/configurations object applied to all requests The current implementation uses axios, so the options can be found here Axios Configuration |
Kind: static method of HttpImpl
Internal:
Param | Description |
---|---|
url | The url |
error | The returned error |
Http Mocker Builder for easy to http testing
Example:
const mockedHttp = HttpMockBuilder .create() .onGetReply(200, {foo: 'get'}) .onPostThrowError(500, 'Post Error', {e: 'post'}) .onPutThrowError(404, 'Put Error', {e: 'put'}) .onDeleteThrowError(403, 'Delete Error', {e: 'delete'}) .build();
const response = await mockedHttp.get('/url');
await mockedHttp.post('/url/post', {faz: 'post'}); // will throw exception
Kind: inner class of http
Creates your Http client
Param | Description |
---|---|
baseURL | The baseUrl, i.e host url |
options | [optional] An options/configurations object applied to all requests The current implementation uses axios, so the options can be found here Axios Configuration |
Kind: static method of HttpImpl
Internal:
Param | Description |
---|---|
url | The url |
error | The returned error |
Http Response
Returned by Http request
Kind: inner class of http
Creates your Http client
Param | Description |
---|---|
baseURL | The baseUrl, i.e host url |
options | [optional] An options/configurations object applied to all requests The current implementation uses axios, so the options can be found here Axios Configuration |
Kind: static method of HttpImpl
Internal:
Param | Description |
---|---|
url | The url |
error | The returned error |
Alias for HttpImpl
Kind: inner class of http
Creates your Http client
Param | Description |
---|---|
baseURL | The baseUrl, i.e host url |
options | [optional] An options/configurations object applied to all requests The current implementation uses axios, so the options can be found here Axios Configuration |
Kind: static method of HttpImpl
Internal:
Param | Description |
---|---|
url | The url |
error | The returned error |
FAQs
Send commands to BURST over HTTP
We found that @burstjs/http demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.