Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 31 - 40 of 48 for read_text (0.1 seconds)

  1. fastapi/exceptions.py

            await websocket.accept()
            while True:
                data = await websocket.receive_text()
                await websocket.send_text(f"Session cookie is: {session}")
                await websocket.send_text(f"Message text was: {data}, for item ID: {item_id}")
        ```
        """
    
        def __init__(
            self,
            code: Annotated[
                int,
                Doc(
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 6.8K bytes
    - Click Count (0)
  2. docs_src/websockets/tutorial001_py39.py

    
    @app.websocket("/ws")
    async def websocket_endpoint(websocket: WebSocket):
        await websocket.accept()
        while True:
            data = await websocket.receive_text()
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 1.4K bytes
    - Click Count (0)
  3. docs/en/docs/reference/websockets.md

                - send
                - accept
                - receive_text
                - receive_bytes
                - receive_json
                - iter_text
                - iter_bytes
                - iter_json
                - send_text
                - send_bytes
                - send_json
                - close
    
    When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch it.
    
    You can import it directly form `fastapi`:
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Aug 06 04:48:30 GMT 2024
    - 1.7K bytes
    - Click Count (0)
  4. build-logic/integration-testing/src/main/kotlin/gradlebuild/integrationtests/tasks/GenerateAutoTestedSamplesTestTask.kt

                        generateForFile(this)
                    }
                }
            }
        }
    
        private fun generateForFile(file: FileTreeElement) {
            val fileContent = file.file.readText()
            val relativePath = file.relativePath.toString()
            require(!fileContent.contains("'''")) {
                "The class with class='autoTested' can't contains triple quotes: $relativePath"
            }
    Created: Wed Dec 31 11:36:14 GMT 2025
    - Last Modified: Fri Dec 19 06:44:41 GMT 2025
    - 3.9K bytes
    - Click Count (0)
  5. tests/test_tutorial/test_websockets/test_tutorial003.py

    def test_websocket_handle_disconnection(client: TestClient):
        with (
            client.websocket_connect("/ws/1234") as connection,
            client.websocket_connect("/ws/5678") as connection_two,
        ):
            connection.send_text("Hello from 1234")
            data1 = connection.receive_text()
            assert data1 == "You wrote: Hello from 1234"
            data2 = connection_two.receive_text()
            client1_says = "Client #1234 says: Hello from 1234"
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1.3K bytes
    - Click Count (0)
  6. tests/test_response_model_data_filter_no_inheritance.py

        name: str
        owner: User
    
    
    @app.post("/users/", response_model=User)
    async def create_user(user: UserCreate):
        return user
    
    
    @app.get("/pets/{pet_id}", response_model=PetOut)
    async def read_pet(pet_id: int):
        user = UserDB(
            email="******@****.***",
            hashed_password="secrethashed",
        )
        pet = PetDB(name="Nibbler", owner=user)
        return pet
    
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1.7K bytes
    - Click Count (0)
  7. tests/test_response_model_data_filter.py

        name: str
        owner: UserBase
    
    
    @app.post("/users/", response_model=UserBase)
    async def create_user(user: UserCreate):
        return user
    
    
    @app.get("/pets/{pet_id}", response_model=PetOut)
    async def read_pet(pet_id: int):
        user = UserDB(
            email="******@****.***",
            hashed_password="secrethashed",
        )
        pet = PetDB(name="Nibbler", owner=user)
        return pet
    
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1.7K bytes
    - Click Count (0)
  8. regression-test/src/androidTest/java/okhttp/regression/compare/AndroidHttpEngineTest.kt

      }
    
      @Test
      fun urlConnection() {
        val conn = engine.openConnection(URL("https://google.com/robots.txt")) as HttpURLConnection
    
        val text =
          conn.inputStream.use {
            it.bufferedReader().readText()
          }
    
        assertEquals(200, conn.responseCode)
    
        assertTrue(text.contains("Disallow"))
      }
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 6.3K bytes
    - Click Count (0)
  9. src/main/java/org/codelibs/core/io/ReaderUtil.java

         * </p>
         *
         * @param reader
         *            the character input stream to read from (must not be {@literal null})
         * @return the text read from the reader
         */
        public static String readText(final Reader reader) {
            assertArgumentNotNull("reader", reader);
    
            final StringBuilder buf = new StringBuilder(BUF_SIZE);
            CopyUtil.copy(reader, buf);
            return new String(buf);
        }
    Created: Sat Dec 20 08:55:33 GMT 2025
    - Last Modified: Thu Jul 31 08:16:49 GMT 2025
    - 4.3K bytes
    - Click Count (0)
  10. .teamcity/src/main/kotlin/model/FunctionalTestBucketGenerator.kt

            val sType = object : TypeToken<BuildProjectToSubprojectTestClassTimes>() {}.type
            val buildProjectClassTimes = gson.fromJson<BuildProjectToSubprojectTestClassTimes>(buildClassTimeJson.readText(), sType)
    
            val result = mutableMapOf<TestCoverage, List<SmallSubprojectBucket>>()
            for (stage in model.stages) {
                for (testCoverage in stage.functionalTests) {
    Created: Wed Dec 31 11:36:14 GMT 2025
    - Last Modified: Thu Apr 10 15:09:32 GMT 2025
    - 7.3K bytes
    - Click Count (0)
Back to Top