<?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="SoupCutClient">
<refmeta>
<refentrytitle role="top_of_page" id="SoupCutClient.top_of_page"
>Convenience HTTP client API</refentrytitle>
<manvolnum
>3</manvolnum>
<refmiscinfo
>Cutterライブラリ</refmiscinfo>
</refmeta>
<refnamediv>
<refname
>Convenience HTTP client API</refname>
<refpurpose
>HTTPクライアントとして動作するためのAPI。</refpurpose>
</refnamediv>

<refsect1 id="SoupCutClient.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="SoupCutClient"
><returnvalue
>SoupCutClient</returnvalue
></link
>&#160;* </entry
><entry role="function_name"
><link linkend="soupcut-client-new"
>soupcut_client_new</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-set-base"
>soupcut_client_set_base</link
>&#160;<phrase role="c_punctuation"
>()</phrase
></entry
></row>
<row
><entry role="function_type"
><link linkend="guint"
><returnvalue
>guint</returnvalue
></link>
</entry
><entry role="function_name"
><link linkend="soupcut-client-send-message"
>soupcut_client_send_message</link
>&#160;<phrase role="c_punctuation"
>()</phrase
></entry
></row>
<row
><entry role="function_type"
><link linkend="guint"
><returnvalue
>guint</returnvalue
></link>
</entry
><entry role="function_name"
><link linkend="soupcut-client-get"
>soupcut_client_get</link
>&#160;<phrase role="c_punctuation"
>()</phrase
></entry
></row>
<row
><entry role="function_type"
><link linkend="guint"
><returnvalue
>guint</returnvalue
></link>
</entry
><entry role="function_name"
><link linkend="soupcut-client-get-n-messages"
>soupcut_client_get_n_messages</link
>&#160;<phrase role="c_punctuation"
>()</phrase
></entry
></row>
<row
><entry role="function_type"
><link linkend="SoupMessage"
><returnvalue
>SoupMessage</returnvalue
></link
>&#160;* </entry
><entry role="function_name"
><link linkend="soupcut-client-get-latest-message"
>soupcut_client_get_latest_message</link
>&#160;<phrase role="c_punctuation"
>()</phrase
></entry
></row>
<row
><entry role="function_type"
><link linkend="GMainContext"
><returnvalue
>GMainContext</returnvalue
></link
>&#160;* </entry
><entry role="function_name"
><link linkend="soupcut-client-get-async-context"
>soupcut_client_get_async_context</link
>&#160;<phrase role="c_punctuation"
>()</phrase
></entry
></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="SoupCutClient.properties" role="properties">
<title role="properties.title"
>プロパティ</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row
><entry role="property_type"
><link linkend="gboolean"
><type
>gboolean</type
></link
></entry
><entry role="property_name"
><link linkend="SoupCutClient--async"
>async</link
></entry
><entry role="property_flags"
>Read / Write</entry
></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="SoupCutClient.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title"
>オブジェクト階層</title>
<screen
><link linkend="GObject"
>GObject</link>
    <phrase role="lineart"
>&#9584;&#9472;&#9472;</phrase
> SoupCutClient
</screen>
</refsect1>


<refsect1 id="SoupCutClient.description" role="desc">
<title role="desc.title"
>説明</title>
<para
><link linkend="SoupCutClient"
><type
>SoupCutClient</type
></link
>オブジェクトはHTTPクライアントとして動作します。<link linkend="SoupCutClient"
><type
>SoupCutClient</type
></link
>は複数のリクエストやレスポンスを管理することができます。また、<link linkend="SoupCutClient"
><type
>SoupCutClient</type
></link
>に関連するアサーションのAPIも提供しています。</para>

</refsect1>
<refsect1 id="SoupCutClient.functions_details" role="details">
<title role="details.title"
>Functions</title>
<refsect2 id="soupcut-client-new" role="function" condition="since:1.0.8">
<title
>soupcut_client_new&#160;()</title>
<indexterm zone="soupcut-client-new" role="1.0.8"
><primary
>soupcut_client_new</primary
></indexterm>
<programlisting language="C"
><link linkend="SoupCutClient"
><returnvalue
>SoupCutClient</returnvalue
></link
>&#160;*
soupcut_client_new (<parameter
><type
>void</type
></parameter
>);</programlisting>
<para
>新たに<link linkend="SoupCutClient"
><type
>SoupCutClient</type
></link
>オブジェクトを生成して返します。</para>
<refsect3 id="soupcut-client-new.returns" role="returns">
<title
>Returns</title>
<para
><link linkend="SoupCutClient"
><type
>SoupCutClient</type
></link
>オブジェクト。</para>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></para
></refsect2>
<refsect2 id="soupcut-client-set-base" role="function" condition="since:1.0.8">
<title
>soupcut_client_set_base&#160;()</title>
<indexterm zone="soupcut-client-set-base" role="1.0.8"
><primary
>soupcut_client_set_base</primary
></indexterm>
<programlisting language="C"
><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_client_set_base (<parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *uri</parameter>);</programlisting>
<para
><parameter
>client</parameter
>のベースURIを<parameter
>uri</parameter
>に設定します。</para>
<refsect3 id="soupcut-client-set-base.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
>uri</para
></entry>
<entry role="parameter_description"
><para
>ベースURIの文字列。</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-send-message" role="function" condition="since:1.0.8">
<title
>soupcut_client_send_message&#160;()</title>
<indexterm zone="soupcut-client-send-message" role="1.0.8"
><primary
>soupcut_client_send_message</primary
></indexterm>
<programlisting language="C"
><link linkend="guint"><returnvalue>guint</returnvalue></link>
soupcut_client_send_message (<parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                             <parameter><link linkend="SoupMessage"><type>SoupMessage</type></link> *message</parameter>);</programlisting>
<para
><parameter
>client</parameter
>を使って<parameter
>message</parameter
>を送信します。<parameter
>client</parameter
>は過去に送信した全ての<link linkend="SoupMessage"
>SoupMessage</link
>の情報を保持しています。</para>
<refsect3 id="soupcut-client-send-message.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
>message</para
></entry>
<entry role="parameter_description"
><para
><link linkend="SoupMessage"
><type
>SoupMessage</type
></link
>オブジェクト。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
</tbody
></tgroup
></informaltable>
</refsect3
><refsect3 id="soupcut-client-send-message.returns" role="returns">
<title
>Returns</title>
<para
>レスポンスのステータスコード。</para>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></para
></refsect2>
<refsect2 id="soupcut-client-get" role="function" condition="since:1.0.8">
<title
>soupcut_client_get&#160;()</title>
<indexterm zone="soupcut-client-get" role="1.0.8"
><primary
>soupcut_client_get</primary
></indexterm>
<programlisting language="C"
><link linkend="guint"><returnvalue>guint</returnvalue></link>
soupcut_client_get (<parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                    <parameter>const <link linkend="gchar"><type>gchar</type></link> *uri</parameter>,
                    <parameter>const <link linkend="gchar"><type>gchar</type></link> *first_query_name</parameter>,
                    <parameter>...</parameter>);</programlisting>
<para
><parameter
>uri</parameter
>とクエリパラメータで指定されたURIにGETリクエストを送信します。もしも<parameter
>client</parameter
>のベースURIが<link linkend="soupcut-client-set-base"
><function
>soupcut_client_set_base()</function
></link
>によって設定されていた場合は、URIはベースURIと<parameter
>uri</parameter
>を組み合わせたものとなります。そうでない場合は、<parameter
>uri</parameter
>は絶対URIである必要があります。</para>
<refsect3 id="soupcut-client-get.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
>uri</para
></entry>
<entry role="parameter_description"
><para
>URI文字列。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
<row
><entry role="parameter_name"
><para
>first_query_name</para
></entry>
<entry role="parameter_description"
><para
>ひとつめのクエリパラメータの名前</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
<row
><entry role="parameter_name"
><para
>...</para
></entry>
<entry role="parameter_description"
><para
><parameter
>first_query_name</parameter
>から始まる、クエリパラメータの名前と値のペア。最後に<link linkend="NULL:CAPS"
><literal
>NULL</literal
></link
>を指定しなければいけません。</para
></entry>
<entry role="parameter_annotations"
></entry
></row>
</tbody
></tgroup
></informaltable>
</refsect3
><refsect3 id="soupcut-client-get.returns" role="returns">
<title
>Returns</title>
<para
>レスポンスのステータスコード。</para>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></para
></refsect2>
<refsect2 id="soupcut-client-get-n-messages" role="function" condition="since:1.0.8">
<title
>soupcut_client_get_n_messages&#160;()</title>
<indexterm zone="soupcut-client-get-n-messages" role="1.0.8"
><primary
>soupcut_client_get_n_messages</primary
></indexterm>
<programlisting language="C"
><link linkend="guint"><returnvalue>guint</returnvalue></link>
soupcut_client_get_n_messages (<parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>);</programlisting>
<para
><parameter
>client</parameter
>が送信した#SoupMessageの数。</para>
<refsect3 id="soupcut-client-get-n-messages.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>
</tbody
></tgroup
></informaltable>
</refsect3
><refsect3 id="soupcut-client-get-n-messages.returns" role="returns">
<title
>Returns</title>
<para
>SoupMessageの数。</para>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></para
></refsect2>
<refsect2 id="soupcut-client-get-latest-message" role="function" condition="since:1.0.8">
<title
>soupcut_client_get_latest_message&#160;()</title>
<indexterm zone="soupcut-client-get-latest-message" role="1.0.8"
><primary
>soupcut_client_get_latest_message</primary
></indexterm>
<programlisting language="C"
><link linkend="SoupMessage"
><returnvalue
>SoupMessage</returnvalue
></link
>&#160;*
soupcut_client_get_latest_message (<parameter
><link linkend="SoupCutClient"
><type
>SoupCutClient</type
></link
> *client</parameter
>);</programlisting>
<para
><parameter
>client</parameter
>が最後に送信した<link linkend="SoupMessage"
><type
>SoupMessage</type
></link
>オブジェクト。</para>
<refsect3 id="soupcut-client-get-latest-message.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>
</tbody
></tgroup
></informaltable>
</refsect3
><refsect3 id="soupcut-client-get-latest-message.returns" role="returns">
<title
>Returns</title>
<para
>最後に送信された<link linkend="SoupMessage"
><type
>SoupMessage</type
></link
>オブジェクト。</para>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></para
></refsect2>
<refsect2 id="soupcut-client-get-async-context" role="function" condition="since:1.0.8">
<title
>soupcut_client_get_async_context&#160;()</title>
<indexterm zone="soupcut-client-get-async-context" role="1.0.8"
><primary
>soupcut_client_get_async_context</primary
></indexterm>
<programlisting language="C"
><link linkend="GMainContext"
><returnvalue
>GMainContext</returnvalue
></link
>&#160;*
soupcut_client_get_async_context (<parameter
><link linkend="SoupCutClient"
><type
>SoupCutClient</type
></link
> *client</parameter
>);</programlisting>
<para
><parameter
>client</parameter
>の非同期コンテキスト。</para>
<refsect3 id="soupcut-client-get-async-context.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>
</tbody
></tgroup
></informaltable>
</refsect3
><refsect3 id="soupcut-client-get-async-context.returns" role="returns">
<title
>Returns</title>
<para
><parameter
>client</parameter
>の<link linkend="GMainContext"
><type
>GMainContext</type
></link
>。<link linkend="NULL:CAPS"
><literal
>NULL</literal
></link
>が返る可能性があります。</para>
</refsect3
><para role="since"
>Since: <link linkend="api-index-1.0.8"
>1.0.8</link
></para
></refsect2>

</refsect1>
<refsect1 id="SoupCutClient.property-details" role="property_details">
<title role="property_details.title"
>プロパティ詳細</title>
<refsect2 id="SoupCutClient--async" role="property"
><title
><literal
>"async"</literal
>プロパティ</title>
<indexterm zone="SoupCutClient--async"
><primary
>SoupCutClient:async</primary
></indexterm>
<programlisting
>“async”                    <link linkend="gboolean"
><type
>gboolean</type
></link
></programlisting>
<para
>セッションが非同期の場合は真。</para
><para
>Owner: SoupCutClient</para>
<para
>Flags: Read / Write</para>
<para
>デフォルト値: FALSE</para>
</refsect2>

</refsect1>
<refsect1 id="SoupCutClient.see-also">
<title
>参考</title>
<para
><link
linkend="cutter-Assertions-for-HTTP-client-and-server"
>HTTPクライアント・サーバ用の検証</link
></para>

</refsect1>

</refentry>
