Code snippets to render code implementation examples for a HTTP request.
<http-code-snippets url="https://api.github.com/authorizations" method="POST" payload='{"scopes": ["public_repo"]}'></http-code-snippets>
npm install --save @advanced-rest-client/http-code-snippets
<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>
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);
git clone https://github.com/advanced-rest-client/http-code-snippets
cd http-code-snippets
npm install
npm start
npm test
This component is a part of API components ecosystem