Skip to main content

Version: 2.13.2304

Request Advanced Match

Prepare environment

Please refer to API7 EE Introduction to complete the environment preparation.

Create route with advanced match

Create an API, this time we don't need to open the plugin.

1

Set the Host and path.

2

Add advanced matching conditions.

3

Fill in the rules form.

4

Submit the form to create the API.

5

Test

Request without company in query

curl 127.0.0.1/anything -i -H "Host: example.com"
HTTP/1.1 404 Not Found
Date: Mon, 13 Mar 2023 02:20:00 GMT
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: APISIX/2.13.2304

{"error_msg":"404 Route Not Found"}

Request with company in query

curl 127.0.0.1/anything?company=100 -i -H "Host: example.com"
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 430
Connection: keep-alive
Date: Mon, 13 Mar 2023 02:24:29 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Server: APISIX/2.13.2304

{
"args": {
"company": "100"
},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Host": "example.com",
"User-Agent": "curl/7.81.0",
"X-Amzn-Trace-Id": "Root=1-640e895d-126e349322be72d5243a12a7",
"X-Forwarded-Host": "example.com"
},
"json": null,
"method": "GET",
"origin": "172.17.0.1, 146.190.80.65",
"url": "http://example.com/anything?company=100"
}

API7.ai Logo

API Management for Modern Architectures with Edge, API Gateway, Kubernetes, and Service Mesh.

Product

API7 Cloud

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN Ltd. 2019 – 2024. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the

Apache Software Foundation