![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@tonybadguy/call-me-maybe
Advanced tools
A Node.js module for creating REST clients with easy request model templating and straightforward extensibility
A Node.js module for creating REST clients with easy request model templating and straightforward extensibility
const send = require('@tonybadguy/call-me-maybe');
send({
url: 'https://httpbin.org/get'
}).then(response => {
console.log(response.statusCode);
console.log(response.body);
console.log(response.headers);
console.log(response.jsonBody.origin);
}).catch(error => {
console.log(error);
});
send({
url: 'https://httpbin.org/post',
method: 'POST',
body: 'my data'
}).then(response => {
console.log(response.body);
console.log(response.jsonBody.data); // 'my data'
});
send({
url: 'https://httpbin.org/post',
method: 'POST',
jsonBody: {
foo: 'bar'
}
}).then(response => {
console.log(response.body);
console.log(response.jsonBody.json.foo); // 'bar'
});
Content-Type
header is automatically set to application/json
.
send({
url: 'https://httpbin.org/post',
method: 'POST',
urlencodedBody: {
foo: 'bar'
}
}).then(response => {
console.log(response.jsonBody.form.foo); // 'bar'
});
Content-Type
header is automatically set to application/x-www-form-urlencoded
.
send({
url: 'https://httpbin.org/{foo}', // 'https://httpbin.org/get'
urlParams:{
foo:'get'
}
}).then(response => {
console.log(response.body);
});
send({
url: 'https://httpbin.org/get', // 'https://httpbin.org/get?foo=bar%20baz'
query:{
foo:'bar baz'
}
}).then(response => {
console.log(response.body);
});
send({
url: 'https://httpbin.org/get',
headers:{
'x-my-header':'oh hai'
}
}).then(response => {
console.log(response.body);
});
This is a shortcut for setting the Authorization header.
send({
url: 'https://httpbin.org/get',
bearerToken: 'mytoken'
}).then(response => {
console.log(response.body);
});
Authorization
header is set to Bearer mytoken
.
send({
url: 'https://httpbin.org/status/500'
}).then(response => {
// won't be called
}).catch(error => {
console.log(error.response.statusCode); // 500
});
'use strict';
const send = require('@tonybadguy/call-me-maybe');
const jsonBodyFilter = require('@tonybadguy/call-me-maybe/lib/response-filters/json-body');
const request = {
url: 'https://httpbin.org/get'
};
const requestFilters = []; // don't use any of the default request filters
const responseFilters = [jsonBodyFilter]; // only use the json body filter
send(request, requestFilters, responseFilters).then(response => {
console.log(response);
});
'use strict';
// a filter that always sets the request body to 'hello world!'
module.exports = {
filter: (request) => {
request.body = 'hello world!';
return request;
}
};
'use strict';
// a filter that always sets the response body to 'hello world!'
module.exports = {
filter: (response) => {
response.body = 'hello world!';
return request;
}
};
FAQs
A Node.js module for creating REST clients with easy request model templating and straightforward extensibility
The npm package @tonybadguy/call-me-maybe receives a total of 741 weekly downloads. As such, @tonybadguy/call-me-maybe popularity was classified as not popular.
We found that @tonybadguy/call-me-maybe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.