Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Tips / Web Services

Web Services

The Web Services API for Plone (wsapi4plone) is a Zope 2 package that provides an XML-RPC Application Programming Interface (API) for the Plone. https://medium.com/@naponmeka/grpc-and-why-it-can-save-you-development-time-436168fd0cbc

export 試試看這個 https://jakearchibald.com/2017/es-modules-in-browsers/ API Intro From Monolith To Cloud Series HelloSign API API Future Microservice Architecture at Medium Microservice Architecture through Story

Web Service 透過 HTTP 協定和 API 來提供軟體功能,通常是給另一個程式使用,而非直接和使用者互動。利用 URL 來存取,回傳的資料常使用 XML 或 JSON 格式,再由程式解析利用。常見的 Web Service 有 REST 和 SOAP 兩大形式協定。

最基本的 Web Service 需要實作 GetCapabilities 和 GetMap,額外可以實作 GetFeatureInfo,WMS 並沒有規範 tile,而另有 WEM Tiling Client Recommendation 來確保產生的地圖包含固定大小的 tile。OpenLayers 是支援多重圖疊的 Javascript 函式庫,應用時要先建立 HTML 檔案,載入使用者的瀏覽器後,再撰寫 Javascript 存取 OpenLayers API 來建立需要的地圖。

Apache Kafka Inspiration for Events Architecture

API first Programming on the Front-end

API Design: Stop Thinking About URLs 診所提供病患與醫生的預約機制

Microservices

Invaluable Guide Building Microservices with Python

早期 latency 議題在 gRPC 問世後大幅改善 透過 Protocol Buffer 定義 Model

Kong API Gateway

REST vs WebSockets Domain Driven Design in the era of Microservices

REST API

何時要用 PATCH 其優缺點是? PUT 和 PATCH 都可以 Update 資料 但 PATCH 只針對局部資料 失敗的話不會自動重傳 原本不存在的資源也不會被建立 safe 是指「該操作不會改變伺服器的資源狀態 而且結果可以被快取」 idempotent 是指「該操作重覆執行都會得到同樣的資源狀態結果 但不一定得到同樣的回傳值 例如 DELETE 第二次可能回傳 404」

RESTful design 對應 CRUD 想像成街道上的建築物

plone.rest 提供 HTTP verb 功能,是協助建立 RESTful endpoint 的底層服務,因為是獨立的套件,也提供另建 endpoint 的彈性。實際操作則透過 plone.restapi 執行。

以 @search 為例,它的篩選格式跟 @@search 類似,但兩者實作仍有不同,像是沒有 * 模糊比對。

plone.rest fix allow_headers edi.restreader/retaccess.py

@users endpoint @theme endpoint barceloneta-mocks Redirect Handling Flask Example Clear a DateTime Field

How It Begins API Discussion RESTful API vs HTTP API: Microsoft Case GraphQL vs REST API URL Shortener with React Apollo GraphQL VCRPY: API Test Tool

JSON Content Type MIME: application/json JSONP: application/javascript Why Should Not Use text/html for JSON

JSON Server to build Fake REST API

Major Categories REST for Plone 2013-04-15

Build Fast REST APIs with Node.js MongoDB Fastify Swagger

WebLion subversion

REST API 並不是資料庫 plone.restapi 相依關係 plone.rest PyJWT collective.jsonify

範例: plone.jsonapi.routes 新增 author 資訊

DeprecationWarning: getSiteEncoding is deprecated. Plone only supports UTF-8 currently. This method always returns "utf-8"

Gull

OData

python-odata

GraphQL

https://medium.com/@aditya_sridhar/an-introduction-to-graphql-how-it-works-and-how-to-use-it-91162ecd72d0 Graphpack: Create with Zero Configuration GraphQL 比較 REST 優點 簡介 MongoDB + Hapi + Swagger

架構項目: Schema Definition Language (SDL), Type, Query, Mutation, Subscription

WSGI

Hanno Schlichting: Zope2 4.0 the main goal was to make it possible to run Zope without all of these extra protocols, so applications like Plone can decide what they want to use. And hopefully porting to Python 3 becomes easier with fewer I/O boundaries to take care of.

Packages using the API

  • msp2plone -- A Microsoft Project XML to Plone 'eXtreme Management' importer.
  • collective.contentrules.wsapi4plone -- A collection of rules for sending content from one Plone site to another on content events, such as when a content object is modified.
  • Parfait -- AtomPub WSGI middleware to enable the Atom Publication Protocol in Plone.
  • wsapi4plone.client -- An XML-RPC client built specifically to interact with Plone.
  • wsapi4plone.webslinger -- An extendable client package for importing content into Plone.
  • wsapi4plone.remotemgmt -- A Plone product for managing Plone sites from a remote application.
  • PloneBatcher -- A package for batch processing Plone content creation, extraction, and updates.

Overview of Enhancements and Bug Fixes

Specifications and Data Formats

  1. XMLRPC specification
  2. JSON specification
  3. REST specification
  4. SOAP specification
  5. Atom Publishing Protocol (APP)

Standard APIs

More Information

Related Information

Securing Serverless APIs with JSON Web Tokens https://github.com/plone/guillotina/issues/495

Open Sourcing Zuul