Search Options

Results per page
Sort
Preferred Languages
Advance

Results 321 - 330 of 527 for Fun (0.04 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/kt/DevServer.kt

          .build()
    
      fun run() {
        try {
          val request = Request(server.url("/"))
    
          client.newCall(request).execute().use { response ->
            if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
            println(response.request.url)
          }
        } finally {
          server.shutdown()
        }
      }
    }
    
    fun main() {
      DevServer().run()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/ParseResponseWithMoshi.kt

    import okhttp3.Request
    
    class ParseResponseWithMoshi {
      private val client = OkHttpClient()
      private val moshi = Moshi.Builder().build()
      private val gistJsonAdapter = moshi.adapter(Gist::class.java)
    
      fun run() {
        val request =
          Request.Builder()
            .url("https://api.github.com/gists/c2a7c39532239ff261be")
            .build()
        client.newCall(request).execute().use { response ->
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  3. tests/test_ws_dependencies.py

    
    def dependency_list() -> List[str]:
        return []
    
    
    DepList = Annotated[List[str], Depends(dependency_list)]
    
    
    def create_dependency(name: str):
        def fun(deps: DepList):
            deps.append(name)
    
        return Depends(fun)
    
    
    router = APIRouter(dependencies=[create_dependency("router")])
    prefix_router = APIRouter(dependencies=[create_dependency("prefix_router")])
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Jun 11 20:35:39 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt

      }
    
      @Test @Disabled
      fun headers() {
        var headers: Headers = Headers.of("", "")
        headers = Headers.of(mapOf("" to ""))
        val size: Int = headers.size()
      }
    
      @Test @Disabled
      fun httpLoggingInterceptor() {
        val interceptor = HttpLoggingInterceptor()
        val level = interceptor.getLevel()
      }
    
      @Test @Disabled
      fun httpUrl() {
        val httpUrl: HttpUrl = HttpUrl.get("")
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/UtilTest.kt

    import kotlin.time.Duration.Companion.nanoseconds
    import okio.buffer
    import okio.source
    import org.junit.jupiter.api.Test
    import org.junit.jupiter.api.assertThrows
    
    class UtilTest {
      @Test
      fun socketIsHealthy() {
        val localhost = InetAddress.getLoopbackAddress()
        val serverSocket = ServerSocket(0, 1, localhost)
    
        val socket = Socket()
        socket.connect(serverSocket.localSocketAddress)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3K bytes
    - Viewed (0)
  6. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

      @BeforeEach
      fun setUp() {
        server.start()
      }
    
      @AfterEach
      fun tearDown() {
        server.shutdown()
      }
    
      @Test
      fun defaultMockResponse() {
        val response = MockResponse()
        assertThat(headersToList(response)).containsExactly("Content-Length: 0")
        assertThat(response.status).isEqualTo("HTTP/1.1 200 OK")
      }
    
      @Test
      fun setResponseMockReason() {
        val reasons =
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/BouncyCastleTest.kt

      var client = clientTestRule.newClient()
      private lateinit var server: MockWebServer
    
      @BeforeEach
      fun setUp(server: MockWebServer) {
        this.server = server
        OkHttpDebugLogging.enable("org.bouncycastle.jsse")
        platform.assumeBouncyCastle()
      }
    
      @Test
      fun testMozilla() {
        assumeNetwork()
    
        val request = Request.Builder().url("https://mozilla.org/robots.txt").build()
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  8. buildSrc/src/main/kotlin/AlpnVersions.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    // https://www.eclipse.org/jetty/documentation/current/alpn-chapter.html#alpn-versions
    private fun alpnBootVersionForPatchVersion(patchVersion: Int): String? {
      return when (patchVersion) {
        in 0..24 -> "8.1.0.v20141016"
        in 25..30 -> "8.1.2.v20141202"
        in 31..50 -> "8.1.3.v20150130"
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Jan 07 16:05:34 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  9. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/RecordedRequest.kt

      @Deprecated(
        message = "Use body.readUtf8()",
        replaceWith = ReplaceWith("body.readUtf8()"),
        level = DeprecationLevel.WARNING,
      )
      fun getUtf8Body(): String = body.readUtf8()
    
      fun getHeader(name: String): String? = headers.values(name).firstOrNull()
    
      override fun toString(): String = requestLine
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/ConnectionCoalescingTest.kt

       * Won't coalesce if we can't clean certs e.g. a dev setup.
       */
      @Test
      fun redirectWithDevSetup() {
        val trustManager: X509TrustManager =
          object : X509TrustManager {
            override fun checkClientTrusted(
              x509Certificates: Array<X509Certificate>,
              s: String,
            ) {
            }
    
            override fun checkServerTrusted(
              x509Certificates: Array<X509Certificate>,
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 18.7K bytes
    - Viewed (0)
Back to top