Simple Symfony app that records and answers requests in different modes, for request debugging
1.9K
Simple symfony app that answers requests in different modes
The Request Handler supports three modes: mirror, proxy and empty while empty is the fallback mode. The modes can be activated by adding a request header called X-Mode.
emptyThe empty mode will return an empty response. Based on the request headers the response body can have different content.
The Accept header and the Content-Type header as fallback will be checked for the supported types application/json, application/xml, text/xml, text/html, and text/plain.
For the type application/json an empty json will be returned. The Content-Type response header will be set to application/json.
{}
For the types application/xml or text/xml a xml document with an empty root node will be returned. The Content-Type response header will be set to the incoming type.
<?xml version="1.0" encoding="UTF-8" ?>
<root>
</root>
For the type text/html a html document with an empty body will be returned. The Content-Type response header will be set to text/html.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>html</title>
</head>
<body></body>
</html>
For the type text/plain and as fallback - in case of no/any other header - a response without content will be sent. The Content-Type response header will be set to text/plain.
mirrorThe mirror mode just return the content sent to the Request Handler. In addition, if the request contains an Accept header, the Content-Type response header will be set to this header.
proxyThe proxy mode requires an additional request header called X-Target. With this header you define witch page should be requested.
docker run -it --rm -p 8080:8080 ideaplexus/request-handler
Content type
Image
Digest
sha256:da9a19889…
Size
71.8 MB
Last updated
13 days ago
docker pull ideaplexus/request-handler