Create an api with an inline script

Create an api with an inline script slide 0
Download Create an api with an inline script

Post on 13-Apr-2017

94 views

Category:

Education

0 download

DESCRIPTION

Create an API with an Inline Script Create an API with an Inline Script Download the API Manager form here http://wso2.com/products/api-manager/ Log in to the API Publisher.…

TRANSCRIPT

Create an API with an Inline Script Create an API with an Inline Script Download the API Manager form here http://wso2.com/products/api-manager/ Log in to the API Publisher. Select the option to design a new API and click Start Creating. Give the information in the table below. To add resources, click the Add button Fill the fields with following data. Name : City_Name Context : /location Version : 1.0.0 Resources URL pattern {town} Request types GET Click on {twon} Click on Next: Implement > Select Prototype API in Implement phase Select Inline option. Expand the GET method. Copy the following script in the Script area. mc.setProperty('CONTENT_TYPE', 'application/json'); var town = mc.getProperty('uri.var.town'); mc.setPayloadJSON('{ "Town" : "'+town+'"}'); Click on Deploy as a Prototype Select Go to API Store Login in API Store as admin Select Prototyped API Then select your API (City_Name) Select API Console option Expand GET method Type the City Name (Any) Click on Try it out button. This is the Final Response of your API