<?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ライブラリ</refmiscinfo>
</refmeta>
<refnamediv>
<refname
>Assertions for HTTP client and server</refname>
<refpurpose
>libsoupを使ってあなたのHTTPクライアント・サーバが期待通りに動作しているかを検証します。</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_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_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.description" role="desc">
<title role="desc.title"
>説明</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 id="soupcut-message-assert-equal-content-type.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
>期待するリスト。</para
></entry>
<entry role="parameter_description"
><para
>期待するContent-Type。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
<row
><entry role="parameter_name"
><para
>message</para
></entry>
<entry role="parameter_description"
><para
><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
>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"
><function
>cut_message()</function
></link
>を見てください。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
</tbody
></tgroup
></informaltable>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></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
><parameter
>expected</parameter
>が<parameter
>client</parameter
>の最後のメッセージのContent-Typeと等しいとパスします。</para>
<refsect3 id="soupcut-client-assert-equal-content-type.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
>期待するリスト。</para
></entry>
<entry role="parameter_description"
><para
>期待するContent-Type。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
<row
><entry role="parameter_name"
><para
>client</para
></entry>
<entry role="parameter_description"
><para
><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
>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"
><function
>cut_message()</function
></link
>を見てください。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
</tbody
></tgroup
></informaltable>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></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
><parameter
>client</parameter
>のステータスコードが2XXならパスします。</para>
<refsect3 id="soupcut-client-assert-response.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
>client</para
></entry>
<entry role="parameter_description"
><para
><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
>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"
><function
>cut_message()</function
></link
>を見てください。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
</tbody
></tgroup
></informaltable>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></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 id="soupcut-client-assert-equal-body.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
>期待するリスト。</para
></entry>
<entry role="parameter_description"
><para
>期待するレスポンスの本体。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
<row
><entry role="parameter_name"
><para
>client</para
></entry>
<entry role="parameter_description"
><para
><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
>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"
><function
>cut_message()</function
></link
>を見てください。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
</tbody
></tgroup
></informaltable>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></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
><parameter
>pattern</parameter
>が<parameter
>client</parameter
>の最後のメッセージのレスポンスの本体にマッチしたときにパスします。</para>
<refsect3 id="soupcut-client-assert-match-body.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
>pattern</para
></entry>
<entry role="parameter_description"
><para
>正規表現。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
<row
><entry role="parameter_name"
><para
>client</para
></entry>
<entry role="parameter_description"
><para
><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
>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"
><function
>cut_message()</function
></link
>を見てください。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
</tbody
></tgroup
></informaltable>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></para
></refsect2>

</refsect1>

</refentry>
