# @advanced-rest-client/http-code-snippets

> Code snippets to display a snippets of making a HTTP request

Latest version **4.0.1** (published 2021-12-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @advanced-rest-client/http-code-snippets
pnpm add @advanced-rest-client/http-code-snippets
yarn add @advanced-rest-client/http-code-snippets
bun add @advanced-rest-client/http-code-snippets
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2021-12-01 |
| First published | 2018-05-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 124.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pawel Uchida-Psztyc |
| Maintainers | jarrodek, twoplustwoone, lbauret, carowright |

## Links

- npm: https://www.npmjs.com/package/@advanced-rest-client/http-code-snippets
- Repository: https://github.com/advanced-rest-client/http-code-snippets
- Homepage: https://github.com/advanced-rest-client/http-code-snippets#readme
- Issues: https://github.com/advanced-rest-client/http-code-snippets/issues
- npm.io page: https://npm.io/package/@advanced-rest-client/http-code-snippets

## Dependencies (4)

- [prismjs](https://npm.io/package/prismjs.md) ^1.25.0
- [lit-element](https://npm.io/package/lit-element.md) ^2.5.1
- [@anypoint-web-components/awc](https://npm.io/package/@anypoint-web-components/awc.md) ^1.0.8
- [@advanced-rest-client/highlight](https://npm.io/package/@advanced-rest-client/highlight.md) ^2.0.1

## Recent versions

- 4.0.1 (latest) — 2021-12-01
- 4.0.0 — 2021-10-19
- 3.2.2 — 2021-03-12
- 3.2.1 — 2021-01-12
- 3.2.0 — 2020-09-22
- 3.1.2 — 2020-01-15
- 3.1.1 — 2019-11-19
- 3.1.0 — 2019-11-08
- 3.0.3 — 2019-10-13
- 3.0.2 — 2019-09-13
- 3.0.1 — 2019-08-29
- 3.0.0 — 2019-06-21
- 3.0.0-preview.2 — 2019-03-23
- 3.0.0-preview.1 — 2019-02-20
- 2.0.7 — 2018-11-28
- … 2 more at https://npm.io/package/@advanced-rest-client/http-code-snippets/versions

## README

[![Published on NPM](https://img.shields.io/npm/v/@advanced-rest-client/http-code-snippets.svg)](https://www.npmjs.com/package/@advanced-rest-client/http-code-snippets)

# &lt;http-code-snippets&gt;

Code snippets to render code implementation examples for a HTTP request.

## Example

```html
<http-code-snippets url="https://api.github.com/authorizations" method="POST" payload='{"scopes": ["public_repo"]}'></http-code-snippets>
```

## Usage

### Installation

```sh
npm install --save @advanced-rest-client/http-code-snippets
```

### In an html file

```html
<html>
  <head>
    <script type="module">
      import './node_modules/@advanced-rest-client/http-code-snippets/http-code-snippets.js';
    </script>
  </head>
  <body>
    <http-code-snippets url="https://api.github.com/authorizations" method="POST" payload='{"scopes": ["public_repo"]}'></http-code-snippets>
  </body>
</html>
```

### In a LitElement

```js
import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/http-code-snippets/http-code-snippets.js';

class SampleElement extends PolymerElement {
  render() {
    const {
      url,
      method,
      headers,
      payload
    } = this;
    return html`
    <http-code-snippets
      .url="${url}"
      .method="${method}"
      .headers="${headers}"
      .payload="${payload}"></http-code-snippets>
    `;
  }
}
customElements.define('sample-element', SampleElement);
```

### Development

```sh
git clone https://github.com/advanced-rest-client/http-code-snippets
cd http-code-snippets
npm install
```

### Running the demo locally

```sh
npm start
```

### Running the tests

```sh
npm test
```

## API components

This component is a part of [API components ecosystem](https://elements.advancedrestclient.com/)

---
_Source: https://npm.io/package/@advanced-rest-client/http-code-snippets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
