![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
@azure/ms-rest-js
Advanced tools
Package description
@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.
Readme
Runtime for isomorphic javascript libraries (that work in the browser and node.js environemnt) generated via Autorest.
npm install
node samples/node-sample.js
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 717,539 weekly downloads. As such, @azure/ms-rest-js popularity was classified as popular.
We found that @azure/ms-rest-js demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.