@advanced-rest-client/http-code-snippets
TypeScript icon, indicating that this package has built-in type declarations

4.0.1 • Public • Published

Published on NPM

<http-code-snippets>

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

Example

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

Usage

Installation

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

In an html file

<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

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

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

Running the demo locally

npm start

Running the tests

npm test

API components

This component is a part of API components ecosystem

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.0.14latest

Version History

VersionDownloads (Last 7 Days)Published
4.0.14
4.0.01
3.2.27
3.2.11
3.2.01
3.1.21
3.1.11
3.1.01
3.0.31
3.0.21
3.0.11
3.0.00
3.0.0-preview.20
3.0.0-preview.10
2.0.70
2.0.60
2.0.00

Package Sidebar

Install

npm i @advanced-rest-client/http-code-snippets

Weekly Downloads

20

Version

4.0.1

License

Apache-2.0

Unpacked Size

127 kB

Total Files

77

Last publish

Collaborators

  • jarrodek
  • twoplustwoone
  • lbauret
  • carowright