首页 > 其他分享 >What is API Gateway Notes, API Driven Dev Notes

What is API Gateway Notes, API Driven Dev Notes

时间:2023-06-17 14:56:07浏览次数:60  
标签:What APIs Notes request response API Gateway backend

API Driven Development
What is API Driven Development?

API Driven Development is a process that allows developers to focus on API design before writing code. The idea is, before you start writing your software, you first design and agree on what the API will be. You focus time up front putting thoughtful design into this API, and the first artifact out of the process is the API design. This API design could be captured in a document, or it could be built out as a Mock API.

Creating the API before you create the code that backs the API provides benefits to both the developers creating the backend code, as well as the clients who will be consuming the API.

Faster Application Development

Both the backend API Code and Client code can be written in parallel once the API design is created. Integrating and merging the two also becomes easier as the API is the contract upon which they both agreed. If the contract didn't change, the release of the actual backend code should go smoothly.

APIs encourage modular architectures

By designing the API up front, you know what functionality should exist in the code and therefore the scope of the program is well defined. This encourages modular and distributed architectures.

Uncover API Incompatibilities quickly

By designing and releasing the API first, you are allowing the consumers of the API to discover incompatible integrations quickly, instead of having integration be the last step for release.

Your App will be ready to connect to the world

Through hosting your code with an API, you can then integrate it with other systems easily.

Documentation

By following API Driven Development you have already documented the API and its features before you implement it. Tools exist in the market that allow you to visualize your API.

To read about Microservices and API Gateway on AWS click here: https://docs.aws.amazon.com/whitepapers/latest/microservices-on-aws/api-implementation.html

To read about API Management in general on AWS click here: https://aws.amazon.com/api-gateway/api-management/

Amazon API Gateway
What is Amazon API Gateway?

Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. API developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud. As an API Gateway API developer, you can create APIs for use in your own client applications. Or you can make your APIs available to third-party app developers.

API Gateway creates RESTful APIs that:

Are HTTP-based.

Enable stateless client-server communication.

Implement standard HTTP methods such as GET, POST, PUT, PATCH, and DELETE.

Read more about Amazon API Gateway at: https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html

API Gateway REST APIs
API Gateway supports multiple types of APIs, in this course we will be focusing on REST APIs.

A REST API in API Gateway is a collection of resources and methods that are integrated with backend HTTP endpoints, Lambda functions, or other AWS services. You can use API Gateway features to help you with all aspects of the API lifecycle, from creation through monitoring your production APIs.

API Gateway REST APIs use a request/response model where a client sends a request to a service and the service responds back synchronously. This kind of model is suitable for many different kinds of applications that depend on synchronous communication.

API Gateway REST APIs have multiple configurable pieces:API Gateway

The diagram above shows what steps a client call makes to the API to access backend resources. A Method resource is integrated with an Integration resource. Both consist of a request and one or more responses. The method request takes the client input, and optionally validates it if configured - either against JSON Schema models or it checks the required request parameters in the URI, query string, and headers of an incoming request are included and non-blank.

If the validation fails, API Gateway immediately fails the request, returns a 400 error response to the caller, and publishes the validation results in CloudWatch Logs. This reduces unnecessary calls to the backend.

Then, the client input is passed to the back end through the integration request. The integration request is where you configure what backend resource the API will be passing the client input to. This is also where you perform any mappings or data transformations potentially using VTL Mappings.

The request then gets passed to the backend resource.

A method response returns the output from the backend to the client through an integration response. You can configure data mappings on the response from the backend at the integration request level. An integration response is an HTTP response encapsulating the backend response. You can map backend responses to specific HTTP codes.

A method request is embodied in a Method resource, whereas an integration request is embodied in an Integration resource. On the other hand, a method response is represented by a MethodResponse resource, whereas an integration response is represented by an IntegrationResponse resource.

Read more about Developing REST APIs with API Gateway at: https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-develop.html

标签:What,APIs,Notes,request,response,API,Gateway,backend
From: https://www.cnblogs.com/yuuken/p/17487478.html

相关文章

  • 对接安心签第三方api(cfca)
    这里用测试企业说明 注册首先前往安心签的测试平台(安心签的技术人员给)注册账号,注册完之后报你的测试企业或者注册号码让他们审核通过; 证书下载审核通过后,安心签的技术人员会给你发两码,也就是序列号和授权码,拿到这个之后进行证书下载,进入安心签的证书格式转化测试系统,填写序列号......
  • Mediapipe实时3D目标检测和跟踪(自动驾驶实现)
    ......
  • 百度 之天气预报API接口
    文档:https://lbsyun.baidu.com/index.php?title=webapi/weather一、申请APIKey百度ak申请地址:http://lbsyun.baidu.com/apiconsole/key二、接口示例https://api.map.baidu.com/weather/v1/?district_id=行政区划编码&data_type=now&ak=应用AK返回结果:{"status":0,"result......
  • CKS 考试题整理 (14)-启用API Server认证
    Context由kubeadm创建的cluster的kubernetesAPI服务器,出于测试目的,临时配置允许未经身份验证和未经授权的访问,授予匿名用户cluster-admin的访问权限。 Task重新配置cluster的KubernetesAPl服务器,以确保只允许经过身份验证和授权的REST请求。使用授权模式Node,R......
  • 京东api接口获得jd商品分类源代码调用示例
    ​  京东商品分类接口的作用是提供一种获取商品分类信息的方式,可以帮助开发者在自己的应用程序中快速获取商品分类数据,从而实现更加精准的商品分类展示、搜索等功能。具体而言,京东商品分类接口(获取免费测试)的作用包括:1.精准地获取商品分类信息:通过商品分类接口,开发者可以获......
  • 京东api接口获得jd商品分类源代码调用示例
     京东商品分类接口的作用是提供一种获取商品分类信息的方式,可以帮助开发者在自己的应用程序中快速获取商品分类数据,从而实现更加精准的商品分类展示、搜索等功能。具体而言,京东商品分类接口(获取免费测试请私信)的作用包括:1.精准地获取商品分类信息:通过商品分类接口,开发者可以获取最......
  • 使用EWS协议读取Exchange邮件时报GSSAPI相关错
    错误信息:GSSAPIoperationfailedwitherrorGSSAPIoperationfailedwitherror-Anunsupportedmechanismwasrequested.NTLMauthenticationrequirestheGSSAPIplugin'gss-ntlmssp'错误原因:.NETCore的默认Docker映像不包含NTLM支持包(即gss-ntlmssp)。结果,由于未在......
  • 通过APIM 包装Power Automate HTTP Request
    1.首先需要在flow中创建“whenaHTTPrequestisreceived” 当创建好,并且把body填写好保存之后,会返回urlhttps://prod-27.southeastasia.logic.azure.com:443/workflows/febbc789e0ad4ed2b649b5f068bee657/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftr......
  • OpenFunction v1.1.0 发布:新增 v1beta2 API,支持 Dapr 状态管理
    OpenFunction是一个开源的云原生FaaS(FunctionasaService,函数即服务)平台,旨在帮助开发者专注于业务逻辑的研发。在过去的几个月里,OpenFunction社区一直在努力工作,为OpenFunction1.1.0版本的发布做准备。今天,我们非常高兴地宣布OpenFunction1.1.0已经发布了!感谢社区各位......
  • aapium报错 An unknown server-side error occurred while processing the command.
    现象:1、appium日志存在报错信息:(1)中间:adbfailedtostartdaemon*(2)结尾:POST/wd/hub/session500287ms2、appium图形界面设置参数后,点击startsession报错提示Anunknownserver-sideerroroccurredwhileprocessingthecommand.Originalerror:Couldnotfindaconn......