<?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-Assertions-for-HTTP-client-and-server">
<refmeta>
<refentrytitle role="top_of_page" id="cutter-Assertions-for-HTTP-client-and-server.top_of_page">Assertions for HTTP client and server</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  CUTTER Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Assertions for HTTP client and server</refname>
<refpurpose>Checks that your HTTP client/server
works as you expect with libsoup support.</refpurpose>
</refnamediv>

<refsect1 id="cutter-Assertions-for-HTTP-client-and-server.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="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="soupcut-message-assert-equal-content-type">soupcut_message_assert_equal_content_type</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="soupcut-client-assert-equal-content-type">soupcut_client_assert_equal_content_type</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="soupcut-client-assert-response">soupcut_client_assert_response</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="soupcut-client-assert-equal-body">soupcut_client_assert_equal_body</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="soupcut-client-assert-match-body">soupcut_client_assert_match_body</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="cutter-Assertions-for-HTTP-client-and-server.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>
</screen>
</refsect1>


<refsect1 id="cutter-Assertions-for-HTTP-client-and-server.description" role="desc">
<title role="desc.title">Description</title>

</refsect1>
<refsect1 id="cutter-Assertions-for-HTTP-client-and-server.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="soupcut-message-assert-equal-content-type" role="function" condition="since:1.0.8">
<title>soupcut_message_assert_equal_content_type&#160;()</title>
<indexterm zone="soupcut-message-assert-equal-content-type" role="1.0.8"><primary>soupcut_message_assert_equal_content_type</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_message_assert_equal_content_type
                               (<parameter>const <link linkend="gchar"><type>gchar</type></link> *expected</parameter>,
                                <parameter><link linkend="SoupMessage"><type>SoupMessage</type></link> *message</parameter>,
                                <parameter>...</parameter>);</programlisting>
<para>Passes if <parameter>expected</parameter>
 == <parameter>message->response_headers->content_type</parameter>
.</para>
<refsect3 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>expected</para></entry>
<entry role="parameter_description"><para>an expected Content-Type.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>message</para></entry>
<entry role="parameter_description"><para>a <link linkend="SoupMessage"><type>SoupMessage</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>optional message. See <link linkend="cut-message"><function>cut_message()</function></link> for details.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since 1.0.8</para></refsect2>
<refsect2 id="soupcut-client-assert-equal-content-type" role="function" condition="since:1.0.8">
<title>soupcut_client_assert_equal_content_type&#160;()</title>
<indexterm zone="soupcut-client-assert-equal-content-type" role="1.0.8"><primary>soupcut_client_assert_equal_content_type</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_client_assert_equal_content_type
                               (<parameter>const <link linkend="gchar"><type>gchar</type></link> *expected</parameter>,
                                <parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                <parameter>...</parameter>);</programlisting>
<para>Passes if <parameter>expected</parameter>
 equals to Content-Type of the latest
message of <parameter>client</parameter>
.</para>
<refsect3 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>expected</para></entry>
<entry role="parameter_description"><para>an expected Content-Type.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>client</para></entry>
<entry role="parameter_description"><para>a <link linkend="SoupCutClient"><type>SoupCutClient</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>optional message. See <link linkend="cut-message"><function>cut_message()</function></link> for details.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since 1.0.8</para></refsect2>
<refsect2 id="soupcut-client-assert-response" role="function" condition="since:1.0.8">
<title>soupcut_client_assert_response&#160;()</title>
<indexterm zone="soupcut-client-assert-response" role="1.0.8"><primary>soupcut_client_assert_response</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_client_assert_response (<parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                <parameter>...</parameter>);</programlisting>
<para>Passes if status code of <parameter>client</parameter>
 is 2XX.</para>
<refsect3 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>client</para></entry>
<entry role="parameter_description"><para>a <link linkend="SoupCutClient"><type>SoupCutClient</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>optional message. See <link linkend="cut-message"><function>cut_message()</function></link> for details.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since 1.0.8</para></refsect2>
<refsect2 id="soupcut-client-assert-equal-body" role="function" condition="since:1.0.8">
<title>soupcut_client_assert_equal_body&#160;()</title>
<indexterm zone="soupcut-client-assert-equal-body" role="1.0.8"><primary>soupcut_client_assert_equal_body</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_client_assert_equal_body (<parameter>const <link linkend="gchar"><type>gchar</type></link> *expected</parameter>,
                                  <parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                  <parameter>...</parameter>);</programlisting>
<para>Passes if <parameter>expected</parameter>
 == <parameter>client->response_body->data</parameter>
.</para>
<refsect3 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>expected</para></entry>
<entry role="parameter_description"><para>an expected response body.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>client</para></entry>
<entry role="parameter_description"><para>a <link linkend="SoupCutClient"><type>SoupCutClient</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>optional message. See <link linkend="cut-message"><function>cut_message()</function></link> for details.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since 1.0.8</para></refsect2>
<refsect2 id="soupcut-client-assert-match-body" role="function" condition="since:1.0.8">
<title>soupcut_client_assert_match_body&#160;()</title>
<indexterm zone="soupcut-client-assert-match-body" role="1.0.8"><primary>soupcut_client_assert_match_body</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_client_assert_match_body (<parameter>const <link linkend="gchar"><type>gchar</type></link> *pattern</parameter>,
                                  <parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                  <parameter>...</parameter>);</programlisting>
<para>Passes if <parameter>pattern</parameter>
 matches the response body of
the latest message of <parameter>client</parameter>
.</para>
<refsect3 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>pattern</para></entry>
<entry role="parameter_description"><para>the regular expression pattern.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>client</para></entry>
<entry role="parameter_description"><para>a <link linkend="SoupCutClient"><type>SoupCutClient</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>optional message. See <link linkend="cut-message"><function>cut_message()</function></link> for details.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since 1.0.8</para></refsect2>

</refsect1>
<refsect1 id="cutter-Assertions-for-HTTP-client-and-server.other_details" role="details">
<title role="details.title">Types and Values</title>

</refsect1>

</refentry>
