<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root>
    <doclet-version-NOT-library-version>1.07</doclet-version-NOT-library-version>
    <class>
        <name>anywheresoftware.b4h.okhttp.OkHttpClientWrapper</name>
        <shortname>OkHttpClient</shortname>
        <comment>机译:
OkHttpClient允许您发出Http请求。建议不要直接使用OkHttpClient，而是使用OkHttpUtil2
使用起来要简单得多的模块。

原文:
OkHttpClient allows you to make Http requests. Instead of using OkHttpClient directly it is recommended to use &lt;link&gt;OkHttpUtil2|https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/&lt;/link&gt; 
modules which are much simpler to use.</comment>
        <owner>process</owner>
        <event>ResponseSuccess (Response As OkHttpResponse, TaskId As Int)</event>
        <event>ResponseError (Response As OkHttpResponse, Reason As String, StatusCode As Int, TaskId As Int)</event>
        <permission>android.permission.INTERNET</permission>
        <method>
            <name>Initialize</name>
            <comment>机译:
初始化此对象。
重要提示:此对象应在Sub process_globals中声明。
EventName-将用于ResponseSuccess和ResponseError事件的前缀。

原文:
Initializes this object.
IMPORTANT: this object should be declared in Sub Process_Globals.
EventName - The prefix that will be used for ResponseSuccess and ResponseError events.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>EventName</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
        <method>
            <name>ExecuteCredentials</name>
            <comment>机译:
与execute相同的行为。用户名和密码将用于基本身份验证和摘要身份验证。
原文:
Same behavior as Execute. The UserName and Password will be used for Basic authentication and Digest authentication.</comment>
            <returntype>boolean</returntype>
            <parameter>
                <name>ba</name>
                <type>anywheresoftware.b4a.BA</type>
            </parameter>
            <parameter>
                <name>Request</name>
                <type>anywheresoftware.b4h.okhttp.OkHttpClientWrapper.OkHttpRequest</type>
            </parameter>
            <parameter>
                <name>TaskId</name>
                <type>int</type>
            </parameter>
            <parameter>
                <name>UserName</name>
                <type>java.lang.String</type>
            </parameter>
            <parameter>
                <name>Password</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
        <method>
            <name>Execute</name>
            <comment>机译:
异步执行OkHttpRequest。稍后将激发ResponseSuccess或ResponseError事件。
如果有一个请求已经运行了相同的TaskId，那么这个方法将返回False，并且新的请求将不会被提交。

原文:
Executes the OkHttpRequest asynchronously. ResponseSuccess or ResponseError events will be fired later.
If there is a request with the same TaskId already running then this method will return False and the new request will not be submitted.</comment>
            <returntype>boolean</returntype>
            <parameter>
                <name>ba</name>
                <type>anywheresoftware.b4a.BA</type>
            </parameter>
            <parameter>
                <name>HttpRequest</name>
                <type>anywheresoftware.b4h.okhttp.OkHttpClientWrapper.OkHttpRequest</type>
            </parameter>
            <parameter>
                <name>TaskId</name>
                <type>int</type>
            </parameter>
        </method>
        <method>
            <name>InitializeAcceptAll</name>
            <comment>机译:
类似于Initialize，但有一个重要的区别。将自动接受所有SSL证书。
只有在尝试连接到位于安全网络中的服务器时才应使用此方法&lt;/b&gt;。

原文:
Similar to Initialize, with one important difference. All SSL certificates will be automatically accepted.
&lt;b&gt;This method should only be used when trying to connect to a server located in a secured network&lt;/b&gt;.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>EventName</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
        <method>
            <name>IsInitialized</name>
            <comment/>
            <returntype>boolean</returntype>
        </method>
    </class>
    <class>
        <name>anywheresoftware.b4h.okhttp.OkHttpClientWrapper.OkHttpRequest</name>
        <shortname>OkHttpRequest</shortname>
        <owner>process</owner>
        <method>
            <name>InitializePatch</name>
            <comment>机译:
初始化请求并将其设置为Http补丁方法。
指定的InputStream将被读取并添加到请求中。

原文:
Initializes the request and sets it to be a Http Patch method.
The specified InputStream will be read and added to the request.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>URL</name>
                <type>java.lang.String</type>
            </parameter>
            <parameter>
                <name>InputStream</name>
                <type>java.io.InputStream</type>
            </parameter>
            <parameter>
                <name>Length</name>
                <type>int</type>
            </parameter>
        </method>
        <method>
            <name>InitializePut</name>
            <comment>机译:
初始化请求并将其设置为Http Put方法。
指定的InputStream将被读取并添加到请求中。

原文:
Initializes the request and sets it to be a Http Put method.
The specified InputStream will be read and added to the request.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>URL</name>
                <type>java.lang.String</type>
            </parameter>
            <parameter>
                <name>InputStream</name>
                <type>java.io.InputStream</type>
            </parameter>
            <parameter>
                <name>Length</name>
                <type>int</type>
            </parameter>
        </method>
        <method>
            <name>InitializePost</name>
            <comment>机译:
初始化请求并将其设置为Http Post方法。
指定的InputStream将被读取并添加到请求中。

原文:
Initializes the request and sets it to be a Http Post method.
The specified InputStream will be read and added to the request.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>URL</name>
                <type>java.lang.String</type>
            </parameter>
            <parameter>
                <name>InputStream</name>
                <type>java.io.InputStream</type>
            </parameter>
            <parameter>
                <name>Length</name>
                <type>int</type>
            </parameter>
        </method>
        <method>
            <name>RemoveHeaders</name>
            <comment>机译:
移除具有给定名称的所有标头。
原文:
Removes all headers with the given name.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>Name</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
        <method>
            <name>InitializeDelete</name>
            <comment>机译:
初始化请求并将其设置为Http Delete方法。
原文:
Initializes the request and sets it to be a Http Delete method.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>URL</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
        <method>
            <name>SetContentType</name>
            <comment>机译:
设置请求的Mime标头。
此方法应仅用于具有有效负载的请求。

原文:
Sets the Mime header of the request.
This method should only be used with requests that have a payload.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>ContentType</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
        <method>
            <name>InitializePatch2</name>
            <comment>机译:
初始化请求并将其设置为Http补丁方法。
指定的数据数组将添加到请求中。
与InitializePost不同，此方法将允许请求重试并在IO错误的情况下多次发送数据。

原文:
Initializes the request and sets it to be a Http Patch method.
The specified Data array will be added to the request.
Unlike InitializePost this method will enable the request to retry and send the data several times in case of IO errors.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>URL</name>
                <type>java.lang.String</type>
            </parameter>
            <parameter>
                <name>Data</name>
                <type>byte[]</type>
            </parameter>
        </method>
        <method>
            <name>InitializePut2</name>
            <comment>机译:
初始化请求并将其设置为Http Put方法。
指定的数据数组将添加到请求中。
与InitializePost不同，此方法将允许请求重试并在IO错误的情况下多次发送数据。

原文:
Initializes the request and sets it to be a Http Put method.
The specified Data array will be added to the request.
Unlike InitializePost this method will enable the request to retry and send the data several times in case of IO errors.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>URL</name>
                <type>java.lang.String</type>
            </parameter>
            <parameter>
                <name>Data</name>
                <type>byte[]</type>
            </parameter>
        </method>
        <method>
            <name>InitializeHead</name>
            <comment>机译:
初始化请求并将其设置为Http头方法。
原文:
Initializes the request and sets it to be a Http Head method.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>URL</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
        <method>
            <name>SetContentEncoding</name>
            <comment>机译:
设置请求的编码标头。
原文:
Sets the encoding header of the request.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>Encoding</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
        <method>
            <name>InitializeGet</name>
            <comment>机译:
初始化请求并将其设置为Http Get方法。
原文:
Initializes the request and sets it to be a Http Get method.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>URL</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
        <method>
            <name>SetHeader</name>
            <comment>机译:
设置具有给定名称的标头的值。如果不存在这样的报头，则将添加一个新的报头。
原文:
Sets the value of the header with the given name. If no such header exists then a new header will be added.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>Name</name>
                <type>java.lang.String</type>
            </parameter>
            <parameter>
                <name>Value</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
        <method>
            <name>InitializeDelete2</name>
            <comment>机译:
初始化请求并将其设置为具有给定负载的Http Delete方法。
原文:
Initializes the request and sets it to be a Http Delete method with the given payload.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>URL</name>
                <type>java.lang.String</type>
            </parameter>
            <parameter>
                <name>Data</name>
                <type>byte[]</type>
            </parameter>
        </method>
        <method>
            <name>InitializePost2</name>
            <comment>机译:
初始化请求并将其设置为Http Post方法。
指定的数据数组将添加到请求中。
与InitializePost不同，此方法将允许请求重试并在IO错误的情况下多次发送数据。

原文:
Initializes the request and sets it to be a Http Post method.
The specified Data array will be added to the request.
Unlike InitializePost this method will enable the request to retry and send the data several times in case of IO errors.</comment>
            <returntype>void</returntype>
            <parameter>
                <name>URL</name>
                <type>java.lang.String</type>
            </parameter>
            <parameter>
                <name>Data</name>
                <type>byte[]</type>
            </parameter>
        </method>
        <property>
            <name>Timeout</name>
            <returntype>int</returntype>
            <parameter>
                <name>t</name>
                <type>int</type>
            </parameter>
            <comment>机译:
获取或设置请求超时，以毫秒为单位。默认值为30,000（30秒）。
原文:
Gets or sets the request timeout, measured in milliseconds. Default value is 30,000 (30 seconds).</comment>
        </property>
    </class>
    <class>
        <name>anywheresoftware.b4h.okhttp.OkHttpClientWrapper.OkHttpResponse</name>
        <shortname>OkHttpResponse</shortname>
        <comment>机译:
保存从服务器返回的响应的对象。
对象在ResponseSuccess事件中传递。
您可以选择同步或异步读取响应。
当不再使用该对象时，通过调用release释放该对象是很重要的。

原文:
An object that holds the response returned from the server.
The object is passed in the ResponseSuccess event.
You can choose to read the response synchronously or asynchronously.
It is important to release this object when it is not used anymore by calling Release.</comment>
        <owner>process</owner>
        <event>StreamFinish (Success As Boolean, TaskId As Int)</event>
        <method>
            <name>Release</name>
            <comment>机译:
释放为此对象分配的资源。
原文:
Frees resources allocated for this object.</comment>
            <returntype>void</returntype>
        </method>
        <method>
            <name>GetAsynchronously</name>
            <comment>机译:
异步读取响应并将其写入给定的OutputStream。
如果有一个已经运行了相同TaskId的请求，那么这个方法将返回False，并释放响应对象。
在完全读取响应之后，将引发StreamFinish事件。
EventName-将处理StreamFinish事件的sub。
输出-来自服务器的流将被写入此流。
CloseOutput-完成时是否关闭指定的输出流。
TaskId-指定给此任务的任务id。
示例:

原文:
Asynchronously reads the response and writes it to the given OutputStream.
If there is a request with the same TaskId already running then this method will return False, and the response object will be released.
The StreamFinish event will be raised after the response has been fully read.
EventName - The sub that will handle the StreamFinish event.
Output - The stream from the server will be written to this stream.
CloseOutput - Whether to close the specified output stream when done.
TaskId - The task id given to this task.
Example:&lt;code&gt;
Sub Http_ResponseSuccess (Response As OkHttpResponse, TaskId As Int)
	Response.GetAsynchronously("ImageResponse", _ 
		File.OpenOutput(File.DirInternalCache, "image.jpg", False), True, TaskId)
End Sub

Sub ImageResponse_StreamFinish (Success As Boolean, TaskId As Int)
	If Success = False Then
		Msgbox(LastException.Message, "Error")
		Return
	End If
	ImageView1.Bitmap = LoadBitmap(File.DirInternalCache, "image.jpg")
End Sub&lt;/code&gt;</comment>
            <returntype>boolean</returntype>
            <parameter>
                <name>ba</name>
                <type>anywheresoftware.b4a.BA</type>
            </parameter>
            <parameter>
                <name>EventName</name>
                <type>java.lang.String</type>
            </parameter>
            <parameter>
                <name>Output</name>
                <type>java.io.OutputStream</type>
            </parameter>
            <parameter>
                <name>CloseOutput</name>
                <type>boolean</type>
            </parameter>
            <parameter>
                <name>TaskId</name>
                <type>int</type>
            </parameter>
        </method>
        <method>
            <name>GetHeaders</name>
            <comment>机译:
返回具有响应标头的映射对象。
每个元素都由一个键和一个值组成，键是头名，值是包含值（一个或多个）的列表。
示例:

原文:
Returns a Map object with the response headers.
Each elements is made of a key which is the header name and a value which is a list containing the values (one or more).
Example:&lt;code&gt;
Dim list1 As List
list1 = response.GetHeaders.Get("Set-Cookie")
For i = 0 To list1.Size - 1
	Log(list1.Get(i))
Next&lt;/code&gt;</comment>
            <returntype>anywheresoftware.b4a.objects.collections.Map</returntype>
        </method>
        <property>
            <name>StatusCode</name>
            <returntype>int</returntype>
            <comment>机译:
返回响应Http代码。
返回-1表示状态代码不可用。

原文:
Returns the response Http code.
Returns -1 is the status code is not available.</comment>
        </property>
        <property>
            <name>ContentLength</name>
            <returntype>long</returntype>
            <comment>机译:
返回响应正文长度。
原文:
Returns the response body length.</comment>
        </property>
        <property>
            <name>ErrorResponse</name>
            <returntype>java.lang.String</returntype>
            <comment>机译:
以字符串形式返回服务器响应（仅用于失败的响应）。
原文:
Returns the server response as a string (for failed responses only).</comment>
        </property>
        <property>
            <name>ContentEncoding</name>
            <returntype>java.lang.String</returntype>
            <comment>机译:
返回内容编码标头。
原文:
Returns the Content-Encoding header.</comment>
        </property>
        <property>
            <name>ContentType</name>
            <returntype>java.lang.String</returntype>
            <comment>机译:
返回内容类型标头。
原文:
Returns the Content-Type header.</comment>
        </property>
    </class>
    <version>1.22</version>
    <dependsOn>okhttp-3.5.0</dependsOn>
    <dependsOn>okio-1.11.0</dependsOn>
</root>
