Package org.apache.apisix.plugin.runner
Class HttpRequest
java.lang.Object
org.apache.apisix.plugin.runner.HttpRequest
- All Implemented Interfaces:
A6Request
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpRequestfrom(ByteBuffer buffer) Gets the specified arg.getArgs()Gets all args.getBody()getConfig(PluginFilter filter) Gets current filter config.longGets the specified headerGets all headers.Gets method.getPath()Gets path.longGets source ip.bytegetType()voidinitCtx(HttpResponse response, Map<String, String> config) voidAdd, rewrite or delete the specified headervoidvoidAdd, rewrite or delete the specified headervoidRewrite path.void
-
Constructor Details
-
HttpRequest
public HttpRequest(io.github.api7.A6.HTTPReqCall.Req req)
-
-
Method Details
-
getConfig
Gets current filter config.- Parameters:
filter- the filter- Returns:
- the config
-
getRequestId
public long getRequestId() -
getSourceIP
Gets source ip.- Returns:
- the source ip
-
getMethod
Gets method.- Returns:
- the method
-
getPath
Gets path.- Returns:
- the path
-
setPath
Rewrite path.- Parameters:
path- the path
-
getHeaders
Gets all headers.Examples:
request.getHeaders()- Returns:
- the all headers
-
getHeader
Gets the specified headerExamples:
request.getHeader("Content-Type");- Parameters:
headerName- the header name- Returns:
- the header value or null
-
setHeader
Add, rewrite or delete the specified headerExamples:
add new header request.setHeader("New-Header", "new header value"); overwrite existing header request.setHeader("Accept", "application/json"); delete existing header request.setHeader("Accept", null);- Parameters:
headerKey- the header keyheaderValue- the header value
-
getArgs
Gets all args.- Returns:
- the args
-
getArg
Gets the specified arg.Examples:
request.getArg("foo");- Parameters:
argName- the arg name- Returns:
- the arg
-
setArg
Add, rewrite or delete the specified headerExamples:
add new arg request.setArg("foo", "bar"); overwrite existing arg request.setArg("foo", "bar"); delete existing header request.setArg("foo", null);- Parameters:
argKey- the arg keyargValue- the arg value
-
getConfToken
public long getConfToken() -
from
-
initCtx
-
getType
public byte getType() -
getVars
-
setVars
-
getBody
-
setBody
-