|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||
public interface HttpConnection
HTTP プロトコルでのネットワークへの接続を定義します。
| フィールドの概要 | |
|---|---|
static String |
GET
HTTP リクエストメソッドの "GET" を表す文字列です。 |
static String |
HEAD
HTTP リクエストメソッドの "HEAD" を表す文字列です。 |
static int |
HTTP_ACCEPTED
HTTPレスポンスのgenerally OK系のステータスコード(=202)。 |
static int |
HTTP_BAD_GATEWAY
HTTP レスポンスの server error 系のステータスコード(=502)。 |
static int |
HTTP_BAD_METHOD
HTTP レスポンスの client error 系のステータスコード(=405)。 |
static int |
HTTP_BAD_REQUEST
HTTP レスポンスの client error 系のステータスコード(=400)。 |
static int |
HTTP_CLIENT_TIMEOUT
HTTP レスポンスの client error 系のステータスコード(=408)。 |
static int |
HTTP_CONFLICT
HTTP レスポンスの client error 系のステータスコード(=409)。 |
static int |
HTTP_CREATED
HTTPレスポンスのgenerally OK系のステータスコード(=201)。 |
static int |
HTTP_ENTITY_TOO_LARGE
HTTP レスポンスの client error 系のステータスコード(=413)。 |
static int |
HTTP_EXPECT_FAILED
HTTP レスポンスの client error 系のステータスコード(=417)。 |
static int |
HTTP_FORBIDDEN
HTTP レスポンスの client error 系のステータスコード(=403)。 |
static int |
HTTP_GATEWAY_TIMEOUT
HTTP レスポンスの server error 系のステータスコード(=504)。 |
static int |
HTTP_GONE
HTTP レスポンスの client error 系のステータスコード(=410)。 |
static int |
HTTP_INTERNAL_ERROR
HTTP レスポンスの server error 系のステータスコード(=500)。 |
static int |
HTTP_LENGTH_REQUIRED
HTTP レスポンスの client error 系のステータスコード(=411)。 |
static int |
HTTP_MOVED_PERM
HTTP レスポンスの relocation/redirect 系のステータスコード(=301)。 |
static int |
HTTP_MOVED_TEMP
HTTP レスポンスの relocation/redirect 系のステータスコード(=302)。 |
static int |
HTTP_MULT_CHOICE
HTTP レスポンスの relocation/redirect 系のステータスコード(=300)。 |
static int |
HTTP_NO_CONTENT
HTTPレスポンスのgenerally OK系のステータスコード(=204)。 |
static int |
HTTP_NOT_ACCEPTABLE
HTTP レスポンスの client error 系のステータスコード(=406)。 |
static int |
HTTP_NOT_AUTHORITATIVE
HTTPレスポンスのgenerally OK系のステータスコード(=203)。 |
static int |
HTTP_NOT_FOUND
HTTP レスポンスの client error 系のステータスコード(=404)。 |
static int |
HTTP_NOT_IMPLEMENTED
HTTP レスポンスの server error 系のステータスコード(=501)。 |
static int |
HTTP_NOT_MODIFIED
HTTP レスポンスの relocation/redirect 系のステータスコード(=304)。 |
static int |
HTTP_OK
HTTPレスポンスのgenerally OK系のステータスコード(=200)。 |
static int |
HTTP_PARTIAL
HTTPレスポンスのgenerally OK系のステータスコード(=206)。 |
static int |
HTTP_PAYMENT_REQUIRED
HTTP レスポンスの client error 系のステータスコード(=402)。 |
static int |
HTTP_PRECON_FAILED
HTTP レスポンスの client error 系のステータスコード(=412)。 |
static int |
HTTP_PROXY_AUTH
HTTP レスポンスの client error 系のステータスコード(=407)。 |
static int |
HTTP_REQ_TOO_LONG
HTTP レスポンスの client error 系のステータスコード(=414)。 |
static int |
HTTP_RESET
HTTPレスポンスのgenerally OK系のステータスコード(=205)。 |
static int |
HTTP_SEE_OTHER
HTTP レスポンスの relocation/redirect 系のステータスコード(=303)。 |
static int |
HTTP_TEMP_REDIRECT
HTTP レスポンスの relocation/redirect 系のステータスコード(=307)。 |
static int |
HTTP_UNAUTHORIZED
HTTP レスポンスの client error 系のステータスコード(=401)。 |
static int |
HTTP_UNAVAILABLE
HTTP レスポンスの server error 系のステータスコード(=503)。 |
static int |
HTTP_UNSUPPORTED_RANGE
HTTP レスポンスの client error 系のステータスコード(=416)。 |
static int |
HTTP_UNSUPPORTED_TYPE
HTTP レスポンスの client error 系のステータスコード(=415)。 |
static int |
HTTP_USE_PROXY
HTTP レスポンスの relocation/redirect 系のステータスコード(=305)。 |
static int |
HTTP_VERSION
HTTP レスポンスの server error 系のステータスコード(=505)。 |
static String |
POST
HTTP リクエストメソッドの "POST" を表す文字列です。 |
| メソッドの概要 | |
|---|---|
void |
close()
接続を閉じてリソースを解放します。 |
void |
connect()
HTTP で接続し、メッセージを送受信します。 |
long |
getDate()
メッセージの日付を取得します。 |
String |
getEncoding()
コンテントのエンコード形式の識別文字列を取得します。 |
long |
getExpiration()
メッセージの有効期限を取得します。 |
String |
getHeaderField(String name)
ヘッダ情報を取得します。 |
long |
getLastModified()
メッセージの更新時刻を取得します。 |
long |
getLength()
コンテンツの長さを取得します。 |
int |
getResponseCode()
レスポンスコードを取得します。 |
String |
getResponseMessage()
レスポンスメッセージを取得します。 |
String |
getType()
コンテントのタイプの識別文字列を取得します。 |
String |
getURL()
接続先のURLを取得します。 |
java.io.DataInputStream |
openDataInputStream()
データの入力ストリームを取得します。 |
java.io.DataOutputStream |
openDataOutputStream()
データの出力ストリームを取得します。 |
java.io.InputStream |
openInputStream()
入力ストリームを取得します。 |
java.io.OutputStream |
openOutputStream()
出力ストリームを取得します。 |
void |
setIfModifiedSince(long ifmodifiedsince)
"If-Modified-Since"ヘッダの値を設定します。 |
void |
setRequestMethod(String method)
リクエストメソッドを設定します。 |
void |
setRequestProperty(String key,
String value)
ヘッダのプロパティ値を設定します。 |
| フィールドの詳細 |
|---|
static final String HEAD
static final String GET
static final String POST
static final int HTTP_OK
static final int HTTP_CREATED
static final int HTTP_ACCEPTED
static final int HTTP_NOT_AUTHORITATIVE
static final int HTTP_NO_CONTENT
static final int HTTP_RESET
static final int HTTP_PARTIAL
static final int HTTP_MULT_CHOICE
static final int HTTP_MOVED_PERM
static final int HTTP_MOVED_TEMP
static final int HTTP_SEE_OTHER
static final int HTTP_NOT_MODIFIED
static final int HTTP_USE_PROXY
static final int HTTP_TEMP_REDIRECT
static final int HTTP_BAD_REQUEST
static final int HTTP_UNAUTHORIZED
static final int HTTP_PAYMENT_REQUIRED
static final int HTTP_FORBIDDEN
static final int HTTP_NOT_FOUND
static final int HTTP_BAD_METHOD
static final int HTTP_NOT_ACCEPTABLE
static final int HTTP_PROXY_AUTH
static final int HTTP_CLIENT_TIMEOUT
static final int HTTP_CONFLICT
static final int HTTP_GONE
static final int HTTP_LENGTH_REQUIRED
static final int HTTP_PRECON_FAILED
static final int HTTP_ENTITY_TOO_LARGE
static final int HTTP_REQ_TOO_LONG
static final int HTTP_UNSUPPORTED_TYPE
static final int HTTP_UNSUPPORTED_RANGE
static final int HTTP_EXPECT_FAILED
static final int HTTP_INTERNAL_ERROR
static final int HTTP_NOT_IMPLEMENTED
static final int HTTP_BAD_GATEWAY
static final int HTTP_UNAVAILABLE
static final int HTTP_GATEWAY_TIMEOUT
static final int HTTP_VERSION
| メソッドの詳細 |
|---|
void connect()
throws java.io.IOException
ミニアプリ実行時に HTTP 通信を行う場合、 他のミニアプリで既に HTTP 通信が行われていることにより、全てのコネクションが利用されているなど HTTP 通信の利用が制限される場合には、 このミニアプリの通信要求はブロックされます。 その際、このメソッドは、このミニアプリの通信要求が処理されるまでブロックします。 また、このミニアプリが通信要求ブロック中にサスペンドした場合、 レジューム後も通信要求はブロックされたままとなり、例外は発生しません。
RuntimeException -
ConnectionException - ConnectionException - ConnectionException - ConnectionException - IllegalStateException -
ConnectionException - ConnectionException - ConnectionException - ConnectionException - ConnectionException - ConnectionException - ConnectionException - SecurityException -
java.io.InterruptedIOException -
java.io.IOException -
void close()
throws java.io.IOException
javax.microedition.io.Connection 内の closejava.io.InterruptedIOException -
java.io.IOException -
java.io.InputStream openInputStream()
throws java.io.IOException
javax.microedition.io.InputConnection 内の openInputStreamRuntimeException -
ConnectionException - java.io.IOException -
java.io.InterruptedIOException -
java.io.IOException -
java.io.OutputStream openOutputStream()
throws java.io.IOException
javax.microedition.io.OutputConnection 内の openOutputStreamRuntimeException -
ConnectionException - java.io.IOException -
java.io.DataInputStream openDataInputStream()
throws java.io.IOException
openInputStream()と同様です。
javax.microedition.io.InputConnection 内の openDataInputStreamRuntimeException -
ConnectionException - java.io.IOException -
java.io.InterruptedIOException -
java.io.IOException -
java.io.DataOutputStream openDataOutputStream()
throws java.io.IOException
openOutputStream()と同様です。
javax.microedition.io.OutputConnection 内の openDataOutputStreamRuntimeException -
ConnectionException - java.io.IOException -
String getEncoding()
getHeaderField("Content-Encoding")と同じです。
javax.microedition.io.ContentConnection 内の getEncodingRuntimeException -
long getLength()
javax.microedition.io.ContentConnection 内の getLengthRuntimeException -
String getType()
getHeaderField("Content-Type")と同じです。
javax.microedition.io.ContentConnection 内の getTypeRuntimeException -
String getURL()
void setRequestMethod(String method)
throws java.io.IOException
リクエストメソッドを設定します。
サーバへのリクエストメッセージのメソッドを設定します。
"HEAD", "GET", "POST"のいずれかでなければなりません。
connect メソッドを呼び出した後にこのメソッドを呼び出した場合は
RuntimeException またはそのサブクラスの例外が発生します。
このモデルでは "HEAD" メソッドを使用することはできません。
method - HTTP リクエストメソッドを表す文字列を指定します。
RuntimeException -
NullPointerException -
IllegalArgumentException -
IllegalArgumentException -
IllegalArgumentException -
IllegalArgumentException -
java.io.IOException -
void setRequestProperty(String key,
String value)
throws java.io.IOException
同じヘッダの設定を複数回行った場合、最後の内容のみ有効になります。
key - プロパティを指定する文字列を指定します。value - 設定値を指定します。
RuntimeException -
java.io.IOException -
int getResponseCode()
throws java.io.IOException
RuntimeException -
java.io.InterruptedIOException -
java.io.IOException -
String getResponseMessage()
throws java.io.IOException
RuntimeException -
java.io.InterruptedIOException -
java.io.IOException -
String getHeaderField(String name)
以下に挙げるヘッダについて取得することができます。
"Date", "Pragma", "Connection",
"Location", "WWW-Authenticate",
"Content-Encoding", "Content-Length",
"Content-Type", "Last-Modified",
"Expires"
また、"x-" で始まるユーザ定義ヘッダも取得可能とします。
他のヘッダを取得できるかどうかは機種依存です。
name - ヘッダのキー値を表す文字列を指定します。
RuntimeException -
long getDate()
RuntimeException -
long getExpiration()
RuntimeException -
long getLastModified()
RuntimeException -
void setIfModifiedSince(long ifmodifiedsince)
ifmodifiedsince - 日付を表す整数値を指定します。
RuntimeException -
|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||
NTT DOCOMO,INC.
本製品または文書は著作権法により保護されており、その使用、複製、再頒布および逆コンパイルを制限するライセンスのもとにおいて頒布されます。NTTドコモ(その他に許諾者がある場合は当該許諾者も含めて)の書面による事前の許可なく、本製品および関連する文書のいかなる部分も、いかなる方法によっても複製することが禁じられます。フォントを含む第三者のソフトウェアは、著作権法により保護されており、その提供者からライセンスを受けているものです。
Sun、Sun Microsystems、Java、J2MEおよびJ2SEは、米国およびその他の国における米国 Sun Microsystems,Inc.の商標または登録商標です。サンのロゴマークは、米国 Sun Microsystems, Inc.の登録商標です。
FeliCaは、ソニー株式会社が開発した非接触ICカードの技術方式です。FeliCaは、ソニー株式会社の登録商標です。
「iモード」、「iアプリ/アイアプリ」、「i-αppli」ロゴ、「DoJa」はNTTドコモの商標または登録商標です。
その他記載された会社名、製品名などは該当する各社の商標または登録商標です。