![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.
npm install r2curl --save
AxiosResponse
// if js, const r2curl = require('r2curl');
import r2curl from 'r2curl';
const response = await axios.get('https://google.com');
const curl = r2curl(response);
console.log(curl);
// stdout "curl -X GET 'https://google.com' -H 'Accept:application/json, text/plain, */*' -H 'User-Agent:axios/0.18.0'"
AxiosRequestConfig
// if js, const r2curl = require('r2curl');
import r2curl from 'r2curl';
// config as AxiosRequestConfig
const config = {
url: 'https://google.com',
method: 'POST',
data: {
caller: 'curl tester',
},
headers: {
'Content-Type': 'application/json',
},
};
const curl = r2curl(reqeustConfig);
console.log(curl);
// stdout `curl -X POST 'https://google.com' -H 'Content-Type:application/json' --data '{"caller":"curl tester"}'`
const response = await axios.request(config);
r2curl
Optionsoption.quote
single
import r2curl from 'r2curl';
// option as IR2CurlOptions.ts
const option = {
/** Determines the type of quota around the body and uri. */
quote: 'double',
};
const curl = r2curl(requestConfig, option);
console.log(curl);
option.defaultContentType
POST
and PUT
requests.application/json; charset=utf-8
(enum) HTTP_HEADER_CONTENT_TYPE
| string
| false
;(boolean) false
to defaultContentType
, you can disable Content-Type
Header.import r2curl, { HTTP_HEADER_CONTENT_TYPE } from 'r2curl';
// const optionUsingEnum = {
// defaultContentType: HTTP_HEADER_CONTENT_TYPE.TEXT,
// };
const option = {
defaultContentType: 'application/json5',
}
const request: AxiosRequestConfig = { url: 'https://google.com', method: 'POST' };
const curl = r2curl(config, option);
console.log(curl);
// output: curl -X POST 'https://google.com' -H 'Content-Type:application/json5
option.forceBody
GET
and DELETE
methods.GET
method. At this point, use this option to activate the Body.import r2curl from 'r2curl';
const config: AxiosRequestConfig = {
url: 'https://google.com',
method: 'GET',
data: {
caller: 'https://github.com/uyu423/r2curl',
sorry: true,
},
};
const option = {
forceBody: true,
}
const curl = r2curl(config, option);
// output: 'curl -X GET \'https://google.com\' --data \'{"caller":"https://github.com/uyu423/r2curl","sorry":true}\''
FAQs
Node.js Request Wrapper (axios, fetch, ..) to cURL Command String
The npm package r2curl receives a total of 2,782 weekly downloads. As such, r2curl popularity was classified as popular.
We found that r2curl 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.