Skip to content

Commit

Permalink
prepare to v6.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xnbox committed Nov 2, 2021
1 parent 9944bec commit 8b52616
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 33 deletions.
30 changes: 15 additions & 15 deletions Cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /api/customer/123 HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -87,7 +87,7 @@ Get response:
<!-- -------------------------------------------------------------------- -->
<br><table><tr><td><h2 id="comments">Comments in dump</h2>

```http
```httpx
# Client request
GET /api/customer/123 HTTP/1.1
Expand Down Expand Up @@ -129,7 +129,7 @@ Content-Type: application/json
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /form1.html HTTP/1.1
.
Expand Down Expand Up @@ -212,7 +212,7 @@ Hello John Doe!
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /form2.html HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -306,7 +306,7 @@ Request failed with status: <code>404 Not found</code>
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /api/customer/5 HTTP/1.1
Accept-Language: ru;*
Expand Down Expand Up @@ -392,7 +392,7 @@ Expected result:
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /api/customers/{id}/profile?mode=* HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -458,7 +458,7 @@ Get response:
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /api/customers/{id}/profile/{id}/info?mode=open&mode=* HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -524,7 +524,7 @@ Get response:
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /api/customers/{id}/profile HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -600,7 +600,7 @@ Prepare external data file <code>customers.json</code>:
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /api/customers/{id}/profile?mode=* HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -678,7 +678,7 @@ Prepare external data file <code>customers.json</code>:
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /api/customers/{id}/profile HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -739,7 +739,7 @@ Get response:
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /favicon.ico HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -803,7 +803,7 @@ The <img src="https://raw.githubusercontent.com/xnbox/DeepfakeHTTP/main/img/favi
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /Albert_Einstein.jpeg HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -937,7 +937,7 @@ Get response:<br>
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /customers/{id}/purchases/{date}/report?format=pdf HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -1143,7 +1143,7 @@ View generated <a href="https://raw.githubusercontent.com/xnbox/DeepfakeHTTP/mai
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /api/customers/{id}/profile?mode=* HTTP/1.1
X-OpenAPI-Summary: Customer profile
X-OpenAPI-Description: Customer profile info
Expand Down Expand Up @@ -1187,7 +1187,7 @@ java -jar df.jar --print-openapi --openapi-title 'Acme-CRM REST API v1.2.3' --du
<li>
Prepare file <code>dump.txt</code>:

```http
```httpx
GET /auth HTTP/1.1
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Expand Down
42 changes: 25 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<li>Copy-paste the content of the dump example to the file <code>dump.txt</code>:
<span></span>

```http
```httpx
GET /api/customer/123 HTTP/1.1
HTTP/1.1 200 OK
Expand Down Expand Up @@ -365,7 +365,11 @@ Command line options
Serve built-in OpenAPI client at specified context<br>
<br>See Also:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cli-openapi-title"><code>--openapi-title &lt;text&gt;</code></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cli-print-openapi"><code>--print-openapi</code></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cli-print-openapi"><code>--print-openapi</code></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#X-OpenAPI-Summary"><code>X-OpenAPI-Summary</code></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#X-OpenAPI-Description"><code>X-OpenAPI-Description</code></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#X-OpenAPI-Tags"><code>X-OpenAPI-Tags</code></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#X-OpenAPI-Parameters"><code>X-OpenAPI-Parameters</code></a>
</td></tr>

<tr></tr>
Expand All @@ -376,7 +380,11 @@ Command line options
Provide custom OpenAPI specification title<br>
<br>See Also:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cli-openapi-path"><code>--openapi-path &lt;path&gt;</code></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cli-print-openapi"><code>--print-openapi</code></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cli-print-openapi"><code>--print-openapi</code></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#X-OpenAPI-Summary"><code>X-OpenAPI-Summary</code></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#X-OpenAPI-Description"><code>X-OpenAPI-Description</code></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#X-OpenAPI-Tags"><code>X-OpenAPI-Tags</code></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#X-OpenAPI-Parameters"><code>X-OpenAPI-Parameters</code></a>
</td></tr>

<tr></tr>
Expand Down Expand Up @@ -638,15 +646,15 @@ Optional REQUEST / RESPONSE headers
<br>

Two seconds request delay:<br>
```http
```httpx
GET / HTTP/1.1
X-Delay: 2000
```

<h2></h2>

Two seconds response delay:<br>
```http
```httpx
HTTP/1.1 200 OK
X-Delay: 2000
```
Expand All @@ -671,7 +679,7 @@ X-Delay: 2000

Get a response body from a remote server:<br>

```http
```httpx
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Source: http://example.com/api/car/1234.json
Expand All @@ -681,7 +689,7 @@ X-Content-Source: http://example.com/api/car/1234.json

Get a response body from a file:<br>

```http
```httpx
HTTP/1.1 200 OK
Content-Type: image/jpeg
X-Content-Source: file:///home/john/photo.jpeg
Expand All @@ -691,7 +699,7 @@ X-Content-Source: file:///home/john/photo.jpeg

Get a response body from a data URI:<br>

```http
```httpx
HTTP/1.1 200 OK
Content-Type: image/gif
X-Content-Source: data:image/gif;base64,R0lGODlhAQABAIAAAP...
Expand All @@ -705,7 +713,7 @@ X-Content-Source: data:image/gif;base64,R0lGODlhAQABAIAAAP...
<p>OpenAPI request summary text.</p>
<i>Example:</i>

```http
```httpx
GET /api/customer{id} HTTP/1.1
X-OpenAPI-Summary: Get customer information
```
Expand All @@ -724,7 +732,7 @@ X-OpenAPI-Summary: Get customer information
<br>
<i>Example:</i>

```http
```httpx
GET /api/customer{id} HTTP/1.1
X-OpenAPI-Summary: Get customer information
X-OpenAPI-Description: This API extracts customer info from db
Expand All @@ -745,7 +753,7 @@ X-OpenAPI-Description: This API extracts customer info from db
<br>
<i>Example:</i>

```http
```httpx
GET /api/customer{id} HTTP/1.1
X-OpenAPI-Summary: Get customer information
X-OpenAPI-Description: This API extracts customer info from db
Expand All @@ -767,7 +775,7 @@ X-OpenAPI-Tags: Work with customer, Buyers, Login info
<br>
<i>Example:</i>

```http
```httpx
GET /api/customer{id} HTTP/1.1
X-OpenAPI-Summary: Get customer information
X-OpenAPI-Description: This API extracts customer info from db
Expand Down Expand Up @@ -795,7 +803,7 @@ X-OpenAPI-Parameters: name=cust_id;description=Customer ID,
<i>Example:</i>
<br>

```http
```httpx
HTTP/1.1
X-Forward-To: http://example.com:8080
```
Expand All @@ -810,7 +818,7 @@ X-Forward-To: http://example.com:8080
<i>Example:</i>
<br>

```http
```httpx
HTTP/1.1 200 OK
X-Handler-CGI: /home/john/myprog.sh param1 param2
```
Expand All @@ -833,7 +841,7 @@ All CGI environment variables are also available to XGI program.<br>
<i>Example:</i>
<br>

```http
```httpx
HTTP/1.1
X-XGI: /home/john/myprog.sh param1 param2
```
Expand Down Expand Up @@ -882,7 +890,7 @@ Among other things, the <code>X-Handler-JS</code> header allows you to modify pe

JavaScript function modify memory data:

```http
```httpx
DELETE /customers/{id}
HTTP/1.1 200 OK
Expand All @@ -902,7 +910,7 @@ function deleteCustomer(request, response, data) {
<h2></h2>
JavaScript function modify memory data and provide response status, headers and body:

```http
```httpx
DELETE /customers/{id}
HTTP/1.1
Expand Down
11 changes: 10 additions & 1 deletion build-DeepfakeHTTP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ E-Mail: [email protected]

<target name="main">
<property name="dollar" value="$" />
<property name="build.version" value="6.3.2" />
<property name="build.version" value="6.4.1" />
<property name="tmpDir" value="${java.io.tmpdir}" />
<property name="tmpAppWar" value="${tmpDir}/app.war" />
<property name="tmpMetaInfDir" value="${tmpDir}/DeepfakeHTTP/META-INF" />
<property name="tmpManifest" value="${tmpMetaInfDir}/MANIFEST.MF" />
<property name="releaseJar" value="${basedir}/RELEASE/df-${build.version}.jar" />
<property name="petclinicZip" value="${basedir}/RELEASE/df-spring-petclinic-${build.version}.zip" />

<delete file="${tmpAppWar}" failonerror="false" />
<war destfile="${tmpAppWar}" webxml="${basedir}/WEB-INF/web.xml" manifest="${basedir}/META-INF/MANIFEST.MF" level="9">
Expand Down Expand Up @@ -71,6 +72,14 @@ E-Mail: [email protected]
<zipfileset prefix="" file="${tmpAppWar}" />
</zip>

<delete file="${petclinicZip}" failonerror="false" />
<zip destfile="${petclinicZip}" level="9">
<zipfileset dir="${basedir}">
<include name="PetClinic/**/**">
</include>
</zipfileset>
</zip>

<delete file="${tmpAppWar}" failonerror="false" />
<delete dir="${tmpMetaInfDir}" />
</target>
Expand Down

0 comments on commit 8b52616

Please sign in to comment.