- WSO2 Developer’s Guide
- Fidel Prieto Estrada Ramón Garrido Lázaro
- 243字
- 2021-07-08 10:05:56
Creating a REST API
Here, we will learn to create a Representational State Transfer (REST) API, that is, how RESTful services are created in WSO2EI. We create them from the Developer Studio dashboard by following these steps:
- Click on REST API:

- Choose Create A New API Artifact and click on Next.
- Add the following information:
- Name: Name of the API; here, we will set it to my1stapi
- Context: This is the root context our services will have, for example, my1stapi. Thus, when calling the API, the URL will look like http://localhost:8280/my1stapi. It must start with /.
- Host name: We can leave it blank. It is used to filter the host that can invoke this API; if it is blank, everyone can call it.
- Port: This is used if we need to bind the API to a specific port; here, we leave it blank.
- Save location: Choose an ESB project to save it. Here, we choose My1stESBProject.
- Click on Finish, and the API structure will be added to the project. It will be placed in the My1stESBProject project in the project explorer in the path:

- If we double-click on the my1stapi.xml file, the API editor will open and will look like this:

- Now we are ready to implement our API functionality. API works the same way as proxy services. They both use in sequence, out sequence, and fault sequence, where logic is implemented.
We will go over RESTful services again later in the book.
推薦閱讀
- The Android Game Developer's Handbook
- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- Python自動化運維快速入門(第2版)
- Java入門很輕松(微課超值版)
- 網頁設計與制作教程(HTML+CSS+JavaScript)(第2版)
- MySQL數據庫管理與開發(慕課版)
- Getting Started with Python Data Analysis
- Linux命令行與shell腳本編程大全(第4版)
- Spring MVC+MyBatis開發從入門到項目實踐(超值版)
- 3D Printing Designs:The Sun Puzzle
- C語言程序設計實驗指導教程
- Visual C++程序開發范例寶典
- Scratch少兒編程高手的7個好習慣
- C#.NET程序設計
- Django 3 Web應用開發從零開始學(視頻教學版)