Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@azure/ms-rest-js
Advanced tools
Isomorphic client Runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest
@azure/ms-rest-js is a package provided by Microsoft Azure that offers a set of tools for making HTTP requests and handling responses, particularly for Azure services. It includes features for authentication, serialization, and deserialization of data, and provides a foundation for building SDKs for Azure services.
HTTP Client
The HTTP Client feature allows you to send HTTP requests and handle responses. This is useful for interacting with RESTful APIs.
const { HttpClient } = require('@azure/ms-rest-js');
const client = new HttpClient();
client.sendRequest({ url: 'https://example.com', method: 'GET' }).then(response => {
console.log(response.bodyAsText);
});
Authentication
The Authentication feature provides support for various authentication mechanisms, such as token-based authentication, which is essential for securely accessing Azure services.
const { TokenCredentials } = require('@azure/ms-rest-js');
const credentials = new TokenCredentials('your-access-token');
const client = new HttpClient(credentials);
client.sendRequest({ url: 'https://example.com', method: 'GET' }).then(response => {
console.log(response.bodyAsText);
});
Serialization and Deserialization
The Serialization and Deserialization feature allows you to convert JavaScript objects to and from JSON, which is useful for sending and receiving data in a structured format.
const { Serializer } = require('@azure/ms-rest-js');
const serializer = new Serializer();
const model = { name: 'example', age: 30 };
const serializedModel = serializer.serialize({ type: { name: 'Composite', className: 'Model', modelProperties: { name: { serializedName: 'name', type: { name: 'String' } }, age: { serializedName: 'age', type: { name: 'Number' } } } } }, model);
console.log(serializedModel);
Axios is a popular HTTP client for making requests to APIs. It is similar to the HTTP Client feature of @azure/ms-rest-js but does not include built-in support for Azure-specific authentication or serialization.
Request is another HTTP client library for Node.js. It provides a simple way to make HTTP requests but lacks the Azure-specific features such as authentication and serialization found in @azure/ms-rest-js.
Node-fetch is a lightweight module that brings window.fetch to Node.js. It is similar to the HTTP Client feature of @azure/ms-rest-js but does not include Azure-specific functionalities like authentication and serialization.
Runtime for isomorphic javascript libraries (that work in the browser and node.js environment) generated via Autorest.
npm install -g typescript
npm install
samples/node-samples.ts
npx ts-node samples/node-sample.js
npm run build
You can find an explanation of how this repository's code works by going to our architecture overview.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
FAQs
Isomorphic client Runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest
The npm package @azure/ms-rest-js receives a total of 371,426 weekly downloads. As such, @azure/ms-rest-js popularity was classified as popular.
We found that @azure/ms-rest-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.