<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/apimock/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/apimock/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 25 Feb 2021 17:57:56 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/apimock/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Home modified by Eric K.</title><link>https://sourceforge.net/p/apimock/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -12,55 +12,79 @@

 **How to add the mocks**

-Open the file config.json and add an URL and the response to return when your URL called.
+Open the file mocks.json and add an URL and the response to return when your URL called.

 **config.json structure**

 ```json
 {
-    "resources":[
+   "paths":[
        {
-           "port":8181,
-           "paths":[
+           "path":"api/exemples",  
+           "contentType":"application/json",
+           "fileAbsolutePath":"mocks/exemples.json",
+           "responseHttpStatus": 400
+       },
+       {
+           "path":"api/notes",
+           "contentType":"application/xml",
+           "fileAbsolutePath":"mocks/notes.xml",
+           "responseHttpStatus": 200,
+           "responseHeaders":[
                {
-                   "path":"api/notes",
-                   "contentType":"application/xml",
-                   "fileAbsolutePath":"mocks\\notes.xml"
+                   "name" : "header1",
+                   "value" : "header1Value"
                },
                {
-                   "path":"api/invoices",
-                   "contentType":"application/json",
-                   "fileAbsolutePath":"C:\\DEV\\mocks\\invoices.json"
+                   "name" : "header2",
+                   "value" : "header2Value"
+               }
+           ],
+           "responseCookies":[
+               {
+                   "name" : "cookie1",
+                   "value" : "cookie1Value"
+               },
+               {
+                   "name" : "cookie2",
+                   "value" : "cookie2Value"
                }
            ]
-       },
-       {
-           "port":8282,
-           "paths":[
-               {
-                   "path":"api/users",
-                   "contentType":"application/json",
-                   "fileAbsolutePath":"C:\\DEV\\mocks\\users.json"
-               }
-           ]
-       }       
+       }
    ]
 }
 ```
-This means when you call ***http://localhost:8181/api/notes*** you'll get in response
+This means when you call ***http://localhost:8080/api/notes*** you'll get in response  
 the content of the file mocks\notes.xml and  Content-type header set to application/xml. \
-You will override the content of config.json, you stay have an orginal copy in config.example.json.
+You will override the content of mocks.json, you stay have an orginal copy in mocks.example.json. \
+You can change the port number on command line(apimock.bat or apimock.sh)
+**contentType**
+Response body content type

-You can find the logs in logs/apimock.log file.
+**fileAbsolutePath**
+File where to ready the response body
+
+**responseHttpStatus**
+Http status that you wish the api to return, default value is 200.
+You can test Authorization by setting it to 203 or 400 for BadRequest
+
+**responseHeaders**
+Headers you with server to return.
+
+**responseCookies**
+Cookies you with server to return.
+
+You can find the logs in apimock.log file.

 NB: 
 * Request methods are ignored, using GET, POST, DELETE results in same response.
-* Ctrl + C to stop servers, closing the window does not free the ports.
+* Ctrl + C to stop servers, closing the window does not free the port.
+* You can set only the fields you wish to use.


 **content**\
-- bin/apimock.jar     --&amp;gt; application
-- logs/apimock.log    --&amp;gt; logs, the file is cleared when application starts
+- apimock.jar         --&amp;gt; application
+- apimock.log         --&amp;gt; logs, the file is cleared when application starts
 - mocks/notes         --&amp;gt; example of response content
 - apimock.bat         --&amp;gt; launches application for windows users
 - apimock.sh          --&amp;gt; launches application for linux users
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric K.</dc:creator><pubDate>Thu, 25 Feb 2021 17:57:56 -0000</pubDate><guid>https://sourceforge.netf860343a1788cd310cf1a8f8c9a6ac8a20104ddf</guid></item><item><title>Home modified by Eric KARANGWA</title><link>https://sourceforge.net/p/apimock/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,8 +1,69 @@
-Welcome to your wiki!
+**Apimock**

-This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
+Apimock is a small tool written in Java to mock  api's in development.
+This occurs when api is not ready or when you want to test diffent scenarios.

-The wiki uses [Markdown](/p/apimock/wiki/markdown_syntax/) syntax.
+If you are using Windows you can run it by double clicking the file apimock.bat
+or on terminal run :\
+**apimock.bat**

-[[members limit=20]]
-[[download_button]]
+For linux users you can use the following command\
+**sh apimock.sh**
+
+**How to add the mocks**
+
+Open the file config.json and add an URL and the response to return when your URL called.
+
+**config.json structure**
+
+```json
+{
+    "resources":[
+       {
+           "port":8181,
+           "paths":[
+               {
+                   "path":"api/notes",
+                   "contentType":"application/xml",
+                   "fileAbsolutePath":"mocks\\notes.xml"
+               },
+               {
+                   "path":"api/invoices",
+                   "contentType":"application/json",
+                   "fileAbsolutePath":"C:\\DEV\\mocks\\invoices.json"
+               }
+           ]
+       },
+       {
+           "port":8282,
+           "paths":[
+               {
+                   "path":"api/users",
+                   "contentType":"application/json",
+                   "fileAbsolutePath":"C:\\DEV\\mocks\\users.json"
+               }
+           ]
+       }       
+   ]
+}
+```
+This means when you call ***http://localhost:8181/api/notes*** you'll get in response
+the content of the file mocks\notes.xml and  Content-type header set to application/xml. \
+You will override the content of config.json, you stay have an orginal copy in config.example.json.
+
+You can find the logs in logs/apimock.log file.
+
+NB: 
+* Request methods are ignored, using GET, POST, DELETE results in same response.
+* Ctrl + C to stop servers, closing the window does not free the ports.
+
+
+**content**\
+- bin/apimock.jar     --&amp;gt; application
+- logs/apimock.log    --&amp;gt; logs, the file is cleared when application starts
+- mocks/notes         --&amp;gt; example of response content
+- apimock.bat         --&amp;gt; launches application for windows users
+- apimock.sh          --&amp;gt; launches application for linux users
+- config.example.json --&amp;gt; example of how to config ports, paths and mocks
+- config.json         --&amp;gt; Active configuration of ports, paths and mocks
+- README.md           --&amp;gt; me :) !!
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric KARANGWA</dc:creator><pubDate>Thu, 19 Nov 2020 12:43:05 -0000</pubDate><guid>https://sourceforge.netd9dc2b4b9ed7ac08411a43bc7accfb712a874323</guid></item><item><title>Home modified by Eric KARANGWA</title><link>https://sourceforge.net/p/apimock/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Welcome to your wiki!&lt;/p&gt;
&lt;p&gt;This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: &lt;span&gt;[SamplePage]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The wiki uses &lt;a class="" href="/p/apimock/wiki/markdown_syntax/"&gt;Markdown&lt;/a&gt; syntax.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;h6&gt;Project Members:&lt;/h6&gt;
	&lt;ul class="md-users-list"&gt;
		&lt;li&gt;&lt;a href="/u/erickarangwa/"&gt;Eric KARANGWA&lt;/a&gt; (admin)&lt;/li&gt;
		
	&lt;/ul&gt;&lt;br/&gt;
&lt;p&gt;&lt;span class="download-button-5fb59c61c7b677a483484a02" style="margin-bottom: 1em; display: block;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric KARANGWA</dc:creator><pubDate>Wed, 18 Nov 2020 22:12:50 -0000</pubDate><guid>https://sourceforge.net055967052ac0ba9a09d91cb59c992ce2ea6e25fd</guid></item></channel></rss>