Python 2.7 telah mencapai akhir dukungan
dan akan
dihentikan penggunaannya
pada 31 Januari 2026. Setelah penghentian penggunaan, Anda tidak akan dapat men-deploy aplikasi Python 2.7, meskipun organisasi Anda sebelumnya menggunakan kebijakan organisasi untuk mengaktifkan kembali deployment runtime lama. Aplikasi Python 2.7 yang ada akan terus berjalan dan menerima traffic setelah
tanggal penghentiannya. Sebaiknya Anda
bermigrasi ke versi Python terbaru yang didukung.
Class HttpTransport
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Class HttpTransport menyediakan transportasi untuk berkomunikasi dengan server HTTP.
HttpTransport
disediakan oleh protorpc.transport
modul.
Konstruktor
-
class HttpTransport
(service_url, protokol=protobuf)
-
Membuat instance objek HttpTransport.
Argumen
- service_url
-
URL tempat layanan berada. Semua komunikasi melalui transport akan mengarah ke metode dalam URL ini.
- protokol
-
Implementasi protokol. Harus menerapkan
encode_message()
dan decode_message()
, yang tersedia di luar protokol lain, seperti protorpc.protojson
, protorpc.protobuf
, dan protorpc.protojson
.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-09-04 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eHttpTransport\u003c/code\u003e facilitates communication with HTTP servers, acting as a transport mechanism.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eprotorpc.transport\u003c/code\u003e module provides the \u003ccode\u003eHttpTransport\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eHttpTransport\u003c/code\u003e constructor requires a \u003ccode\u003eservice_url\u003c/code\u003e to specify the location of the service for communication.\u003c/p\u003e\n"],["\u003cp\u003eA protocol implementing \u003ccode\u003eencode_message()\u003c/code\u003e and \u003ccode\u003edecode_message()\u003c/code\u003e, like those in \u003ccode\u003eprotorpc.protojson\u003c/code\u003e or \u003ccode\u003eprotorpc.protobuf\u003c/code\u003e, is also required in the constructor.\u003c/p\u003e\n"]]],[],null,["# The HttpTransport Class\n\nThe HttpTransport class provides a transport for communicating with HTTP servers.\n\n`HttpTransport` is provided by the `protorpc.transport` module.\n\nConstructor\n-----------\n\n\nclass HttpTransport\n(service_url, protocol=protobuf)\n\n:\n Instantiates an HttpTransport object.\n\n **Arguments**\n\n service_url\n :\n The URL where the service is located. All communication via the transport will go to methods under this URL.\n\n protocol\n :\n The protocol implementation. Must implement `encode_message()` and `decode_message()`, which are available in outside other protocols, such as `protorpc.protojson`, `protorpc.protobuf`, and `protorpc.protojson`."]]