@stoplight/request-maker
Request Maker Component for Studio
Last updated a day ago by marbemac .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @stoplight/request-maker 
SYNC missed versions from official npm registry.

request-maker component

Maintainability Test Coverage

Request Maker is a Component for Studio to craft HTTP Requests, send them somewhere and display them back in the component.

Installation

Supported in modern browsers and node.

  yarn add request-maker

Usage

This library exports RequestMaker, ActionBar, ResponseEditor, and ResponseViewer component.

RequestMaker holds the state of the application. It can be initialized by providing IHttpOperation and IHttpRequest.

All request maker parameters are optional:

  • operation: IHttpOperation
  • request: IHttpRequest
  • hideRequestEditor: boolean
  • hideResposne: boolean

Properties taken from IHttpOperation:

  • method
  • path
  • servers

Properties taken from IHttpRequest:

  • method
  • path
  • baseUrl
  • headers
  • query
  • body

Properties from IHttpRequest take precedence over IHttpMethod

RequestMaker

  <RequestMaker />
  const operation = IHttpOperation = {
  id: '1',
  method: 'post',
  path: '/operationResource',
  request: {
    path: [],
    query: [],
    headers: [],
    cookie: [],
    body: {
      contents: [],
    },
  },
  responses: [],
  servers: [
    {
      url: 'http://localhost:9001',
    },
    {
      url: 'http://localhost:3000',
    },
    {
      url: 'http://example.com',
    },
  ],
  security: [],
};

const request: IHttpRequest<string> = {
  baseUrl: 'http://localhost:8080',
  method: 'get',
  url: '/requestResource',
  headers: {
    testHeader: 'testHeaderValue',
  },
  query: {
    testQueryParam: ['testQueryValue'],
  },
  body: '{"valid": true}',
};
  <RequestMaker operation={operation} request={request}/>

That's all you need to do. It'll manage the state for you and place the components here and there.

Using components separately

In case you want to craft your own component, you can use the parts separately, but you'll have to manage its state.

Current Tags

  • 2.16.1                                ...           latest (a day ago)

44 Versions

  • 2.16.1                                ...           a day ago
  • 2.16.0                                ...           2 days ago
  • 2.15.0                                ...           2 days ago
  • 2.14.3                                ...           2 days ago
  • 2.14.2                                ...           8 days ago
  • 2.14.1                                ...           8 days ago
  • 2.14.0                                ...           8 days ago
  • 2.13.6                                ...           9 days ago
  • 2.13.5                                ...           9 days ago
  • 2.13.4                                ...           9 days ago
  • 2.13.3                                ...           9 days ago
  • 2.13.2                                ...           9 days ago
  • 2.13.1                                ...           9 days ago
  • 2.13.0                                ...           10 days ago
  • 2.12.1                                ...           12 days ago
  • 2.12.0                                ...           14 days ago
  • 2.11.5                                ...           14 days ago
  • 2.11.4                                ...           17 days ago
  • 2.11.3                                ...           17 days ago
  • 2.11.2                                ...           18 days ago
  • 2.11.1                                ...           21 days ago
  • 2.11.0                                ...           21 days ago
  • 2.10.1                                ...           21 days ago
  • 2.10.0                                ...           23 days ago
  • 2.9.0                                ...           a month ago
  • 2.8.1                                ...           a month ago
  • 2.8.0                                ...           a month ago
  • 2.7.0                                ...           a month ago
  • 2.6.0                                ...           2 months ago
  • 2.5.0                                ...           2 months ago
  • 2.4.0                                ...           4 months ago
  • 2.3.2                                ...           4 months ago
  • 2.3.1                                ...           4 months ago
  • 2.3.0                                ...           4 months ago
  • 2.2.0                                ...           5 months ago
  • 2.1.0                                ...           5 months ago
  • 2.0.0                                ...           5 months ago
  • 1.3.1                                ...           7 months ago
  • 1.3.0                                ...           7 months ago
  • 1.2.0                                ...           8 months ago
  • 1.1.2                                ...           8 months ago
  • 1.1.1                                ...           8 months ago
  • 1.1.0                                ...           8 months ago
  • 0.0.0                                ...           8 months ago
Downloads
Today 0
This Week 75
This Month 369
Last Day 39
Last Week 204
Last Month 164
Dependencies (11)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |