<div dir="ltr">Hi Christian,<br><br>Thank you for the reply! <br><br>My app will be doing some simple HTTP, with GET and POST requests that has a text response body, e.g. "Received". I think following the mghttpd test will suffice. <br><br>However, I'm currently looking at the code for the mghttpd test and I was wondering if there is a way I can run it or get a non-test version of it? I can't really tell what I need or what the code does without running it.<br><br>Cheers.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 6 October 2017 at 07:47, Christian Mauderer <span dir="ltr"><<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Am 05.10.2017 um 17:52 schrieb Hui Yie Teh:<br>
> Hi,<br>
><br>
> I am trying to build a HTTP client using RTEMS. Is there any tutorials<br>
> that I can follow? I already have a server running, and I just need to<br>
> send some GET and POST requests.<br>
><br>
> I am new to RTEMS and embedded programming in general. Any help is much<br>
> appreciated.<br>
><br>
> Cheers,<br>
> Yie<br>
><br>
<br>
</div></div>Hello Yie,<br>
<br>
it depends a little on your application.<br>
<br>
If you just want to learn a little about the HTTP protocol and only want<br>
to try some requests, you can just use a raw socket. The HTTP basics are<br>
really quite simple if you don't want to use things like compression or<br>
different MIME types. Writing a simple request for some simple html<br>
document is quite easy. Something like that is done in the test for the<br>
mghttpd in RTEMS:<br>
<br>
    <a href="https://git.rtems.org/rtems/tree/testsuites/libtests/mghttpd01" rel="noreferrer" target="_blank">https://git.rtems.org/rtems/<wbr>tree/testsuites/libtests/<wbr>mghttpd01</a><br>
<br>
Note that there are most likely a lot of error cases that are not caught<br>
in that test (like unexpected HTTP responses).<br>
<br>
If you need your client for some more professional application or<br>
something that should be more robust, I would suggest to use some<br>
library that does most of the low level handling. I'm not aware of one<br>
integrated into RTEMS but it shouldn't be hard to find one that works.<br>
<br>
I think that I have seen some client functions in civetweb (still<br>
MIT-licensed fork of mongoose httpd which has been forked off before the<br>
license change in mongoose). From my experience, civetweb needs only<br>
very few modifications to work with RTEMS.<br>
<br>
Most likely you can also (with some more effort) compile some bigger C<br>
or C++ libraries like libcurl. But I haven't tried that yet. By the way:<br>
there is also a large list of http client libraries on the libcurl<br>
Homepage: <a href="https://curl.haxx.se/libcurl/competitors.html" rel="noreferrer" target="_blank">https://curl.haxx.se/libcurl/<wbr>competitors.html</a><br>
<br>
Regards<br>
<span class="HOEnZb"><font color="#888888"><br>
Christian<br>
</font></span></blockquote></div><br></div>