response-body-view

WebJar for response-body-view

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

org.webjars.bowergithub.advanced-rest-client
ArtifactId

ArtifactId

response-body-view
Last Version

Last Version

2.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

response-body-view
WebJar for response-body-view
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/advanced-rest-client/response-body-view

Download response-body-view

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.advanced-rest-client/response-body-view/ -->
<dependency>
    <groupId>org.webjars.bowergithub.advanced-rest-client</groupId>
    <artifactId>response-body-view</artifactId>
    <version>2.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.advanced-rest-client/response-body-view/
implementation 'org.webjars.bowergithub.advanced-rest-client:response-body-view:2.0.4'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.advanced-rest-client/response-body-view/
implementation ("org.webjars.bowergithub.advanced-rest-client:response-body-view:2.0.4")
'org.webjars.bowergithub.advanced-rest-client:response-body-view:jar:2.0.4'
<dependency org="org.webjars.bowergithub.advanced-rest-client" name="response-body-view" rev="2.0.4">
  <artifact name="response-body-view" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.advanced-rest-client', module='response-body-view', version='2.0.4')
)
libraryDependencies += "org.webjars.bowergithub.advanced-rest-client" % "response-body-view" % "2.0.4"
[org.webjars.bowergithub.advanced-rest-client/response-body-view "2.0.4"]

Dependencies

compile (12)

Group / Artifact Type Version
org.webjars.bowergithub.advanced-rest-client : json-table jar [2.0.0,3)
org.webjars.bowergithub.advanced-rest-client : response-highlighter jar [2.0.0,3)
org.webjars.bowergithub.advanced-rest-client : clipboard-copy jar [2.0.0,3)
org.webjars.bowergithub.advanced-rest-client : arc-icons jar [2.0.0,3)
org.webjars.bowergithub.advanced-rest-client : json-viewer jar [2.0.0,3)
org.webjars.bowergithub.polymer : polymer jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : paper-toast jar [2.1.0,3)
org.webjars.bowergithub.advanced-rest-client : xml-viewer jar [2.0.0,3)
org.webjars.bowergithub.advanced-rest-client : response-raw-viewer jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : paper-icon-button jar [2.1.0,3)
org.webjars.bowergithub.polymerelements : iron-pages jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : paper-dialog jar [2.1.1,3)

Project Modules

There are no modules declared in this project.

This component is deprecated

Use @advanced-rest-client/arc-response instead.


Published on NPM

Build Status

<response-body-view>

An element to display a HTTP response body in accessible and human readable form.

<response-body-view responsetext="# Hello world" contenttype="application/markdown"></response-body-view>

Note, the element internally uses TextDecoder class for responses that are an ArrayBuffer instead of text. If the response can be an ArrayBuffer you need to ensure the TextDecoder class is supported / polyfilled.

Usage

Installation

npm install --save @advanced-rest-client/response-body-view

In an html file

<html>
  <head>
    <script type="module">
      import '@advanced-rest-client/response-body-view/response-body-view.js';
    </script>
  </head>
  <body>
    <response-body-view></response-body-view>
    <script>
    {
      const view = document.querySelector('response-body-view');
      view.responseText = JSON.stringify({
        data: 'some data'
      });
      view.contentType = 'application/json'
    }
    </script>
  </body>
</html>

In a LitElement

import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/response-body-view/response-body-view.js';

class SampleElement extends PolymerElement {
  render() {
    return html`
    <response-body-view
      responsetext="# Hello world"
      contenttype="application/markdown"
      @url-change-action="${this._urlClickHandler}"
      @request-workspace-append="${this._urlMetaClickHandler}"></response-body-view>
    `;
  }

  _urlClickHandler(e) {
    console.log(`User clicked on ${e.detail.value}`);
  }

  _urlMetaClickHandler(e) {
    console.log(`User clicked on ${e.detail.value} with ctrl or meta`);
  }
}
customElements.define('sample-element', SampleElement);

Development

git clone https://github.com/advanced-rest-client/response-body-view
cd response-body-view
npm install

Running the demo locally

npm start

Running the tests

npm test

API components

This components is a part of API components ecosystem

Breaking Changes in v3

  • XML custom view has been replaced with Prism syntax highlighting
  • Prism parsing timeout is no longer supported, it wasn't working well anyway
  • Response preview has been removed, it couldn't reliably render response view
org.webjars.bowergithub.advanced-rest-client

ARC

A set of repositories related to the Advanced REST Client and API console (by Mulesoft)

Versions

Version
2.0.4