<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cutter-Convenience-HTTP-server-API">
<refmeta>
<refentrytitle role="top_of_page" id="cutter-Convenience-HTTP-server-API.top_of_page">Convenience HTTP server API</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CUTTER Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Convenience HTTP server API</refname>
<refpurpose>API to work as HTTP server.</refpurpose>
</refnamediv>

<refsect1 id="cutter-Convenience-HTTP-server-API.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="function_type"><link linkend="SoupServer"><returnvalue>SoupServer</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="soupcut-server-take">soupcut_server_take</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="SoupServer"><returnvalue>SoupServer</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="soupcut-server-take-new">soupcut_server_take_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="soupcut-server-build-uri">soupcut_server_build_uri</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>


<refsect1 id="cutter-Convenience-HTTP-server-API.description" role="desc">
<title role="desc.title">Description</title>
<para>Useful wrappers for <link linkend="SoupServer"><type>SoupServer</type></link> are provided.</para>

</refsect1>
<refsect1 id="cutter-Convenience-HTTP-server-API.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="soupcut-server-take" role="function" condition="since:1.0.8">
<title>soupcut_server_take&#160;()</title>
<indexterm zone="soupcut-server-take" role="1.0.8"><primary>soupcut_server_take</primary></indexterm>
<programlisting language="C"><link linkend="SoupServer"><returnvalue>SoupServer</returnvalue></link>&#160;*
soupcut_server_take (<parameter><link linkend="SoupServer"><type>SoupServer</type></link> *server</parameter>);</programlisting>
<para><parameter>server</parameter>
 is shut down and unref when tear down.</para>
<refsect3 id="soupcut-server-take.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>server</para></entry>
<entry role="parameter_description"><para>a <link linkend="SoupServer"><type>SoupServer</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="soupcut-server-take.returns" role="returns">
<title>Returns</title>
<para> <parameter>server</parameter>
owned by Cutter. Don't <link linkend="g-object-unref"><function>g_object_unref()</function></link> it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.8">1.0.8</link></para></refsect2>
<refsect2 id="soupcut-server-take-new" role="function" condition="since:1.0.8">
<title>soupcut_server_take_new&#160;()</title>
<indexterm zone="soupcut-server-take-new" role="1.0.8"><primary>soupcut_server_take_new</primary></indexterm>
<programlisting language="C"><link linkend="SoupServer"><returnvalue>SoupServer</returnvalue></link>&#160;*
soupcut_server_take_new (<parameter><link linkend="GMainContext"><type>GMainContext</type></link> *context</parameter>);</programlisting>
<para>Creates and returns a new <link linkend="SoupServer"><type>SoupServer</type></link>, whose context is <parameter>context</parameter>
.
The server is shut down and unref when tear down.</para>
<refsect3 id="soupcut-server-take-new.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GMainContext"><type>GMainContext</type></link> for the main loop of a new server.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="soupcut-server-take-new.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="SoupServer"><type>SoupServer</type></link> owned by Cutter. Don't <link linkend="g-object-unref"><function>g_object_unref()</function></link> it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.8">1.0.8</link></para></refsect2>
<refsect2 id="soupcut-server-build-uri" role="function" condition="since:1.0.8">
<title>soupcut_server_build_uri&#160;()</title>
<indexterm zone="soupcut-server-build-uri" role="1.0.8"><primary>soupcut_server_build_uri</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
soupcut_server_build_uri (<parameter><link linkend="SoupServer"><type>SoupServer</type></link> *server</parameter>,
                          <parameter>const <link linkend="gchar"><type>gchar</type></link> *path</parameter>);</programlisting>
<para>an URI is built and returned with the base uri of <parameter>server</parameter>
 and <parameter>path</parameter>
.</para>
<refsect3 id="soupcut-server-build-uri.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>server</para></entry>
<entry role="parameter_description"><para>a <link linkend="SoupServer"><type>SoupServer</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>a path.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="soupcut-server-build-uri.returns" role="returns">
<title>Returns</title>
<para> a new uri string owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.8">1.0.8</link></para></refsect2>

</refsect1>
<refsect1 id="cutter-Convenience-HTTP-server-API.other_details" role="details">
<title role="details.title">Types and Values</title>

</refsect1>
<refsect1 id="cutter-Convenience-HTTP-server-API.see-also">
<title>See Also</title>
<para><link
           linkend="cutter-Assertions-for-HTTP-client-and-server">
           Assertions for HTTP client and server</link></para>

</refsect1>

</refentry>
