Skip to content

Commit ec7c59e

Browse files
committed
[add]: readme
Signed-off-by: AhmedLotfy02 <[email protected]>
1 parent d84905b commit ec7c59e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<h1>Sample java spring boot with xml</h1>
2+
<p>This project is a Spring Boot application that serves a simple REST API endpoint returning XML responses.</p>
3+
4+
<h2>How to Run</h2>
5+
<p>Ensure you have Java 17 installed. Then, follow these steps:</p>
6+
<ol>
7+
<li>Clone the repository </li>
8+
<li>Navigate into the project directory</li>
9+
<li>Build the project: <code>mvn clean install</code></li>
10+
<li>Run the application: <code>mvn spring-boot:run</code></li>
11+
</ol>
12+
13+
<h2>API Endpoints</h2>
14+
<h3>Get User (Returns XML)</h3>
15+
<p>Endpoint: <code>GET /api/user</code></p>
16+
17+
<h3>Testing with Curl</h3>
18+
<p>To make a request using <code>curl</code>, use the following command:</p>
19+
<pre>
20+
<code>curl -X GET -H "Accept: application/xml" http://localhost:8080/api/user</code>
21+
</pre>
22+
23+
<h2>Expected XML Response</h2>
24+
<pre>
25+
<code>
26+
&lt;User&gt;
27+
&lt;name&gt;John Doe&lt;/name&gt;
28+
&lt;age&gt;30&lt;/age&gt;
29+
&lt;phone&gt;0101233333&lt;/phone&gt;
30+
&lt;/User&gt;
31+
</code>
32+
</pre>
33+
34+
<h2>Dependencies</h2>
35+
<ul>
36+
<li>Spring Boot</li>
37+
<li>Spring Web</li>
38+
<li>JAXB for XML serialization</li>
39+
</ul>

0 commit comments

Comments
 (0)