Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 2,327 for convert (0.19 sec)

  1. docs/en/docs/advanced/response-directly.md

    For example, you cannot put a Pydantic model in a `JSONResponse` without first converting it to a `dict` with all the data types (like `datetime`, `UUID`, etc) converted to JSON-compatible types.
    
    For those cases, you can use the `jsonable_encoder` to convert your data before passing it to a response:
    
    ```Python hl_lines="6-7  21-22"
    {!../../../docs_src/response_directly/tutorial001.py!}
    ```
    
    !!! note "Technical Details"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 29 14:02:58 GMT 2020
    - 3K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/primitives/ShortsTest.java

      }
    
      public void testStringConverter_convert() {
        Converter<String, Short> converter = Shorts.stringConverter();
        assertThat(converter.convert("1")).isEqualTo((Short) (short) 1);
        assertThat(converter.convert("0")).isEqualTo((Short) (short) 0);
        assertThat(converter.convert("-1")).isEqualTo((Short) (short) (-1));
        assertThat(converter.convert("0xff")).isEqualTo((Short) (short) 255);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 29 15:43:06 GMT 2024
    - 26.6K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/response-change-status-code.md

    But if the data didn't exist, you want to create it, and return an HTTP status code of "CREATED" `201`.
    
    But you still want to be able to filter and convert the data you return with a `response_model`.
    
    For those cases, you can use a `Response` parameter.
    
    ## Use a `Response` parameter
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/header-params.md

    Most of the standard headers are separated by a "hyphen" character, also known as the "minus symbol" (`-`).
    
    But a variable like `user-agent` is invalid in Python.
    
    So, by default, `Header` will convert the parameter names characters from underscore (`_`) to hyphen (`-`) to extract and document the headers.
    
    Also, HTTP headers are case-insensitive, so, you can declare them with standard Python style (also known as "snake_case").
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  5. src/test/java/org/codelibs/core/convert/BinaryConversionUtilTest.java

     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
     * either express or implied. See the License for the specific language
     * governing permissions and limitations under the License.
     */
    package org.codelibs.core.convert;
    
    import static org.hamcrest.CoreMatchers.is;
    import static org.hamcrest.CoreMatchers.nullValue;
    import static org.junit.Assert.assertThat;
    
    import org.codelibs.core.exception.ClIllegalArgumentException;
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 2K bytes
    - Viewed (0)
  6. docs_src/header_params/tutorial002_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, Header
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        strange_header: Annotated[
            Union[str, None], Header(convert_underscores=False)
        ] = None,
    ):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 288 bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/core/beans/converter/TimeConverter.java

     */
    package org.codelibs.core.beans.converter;
    
    import static org.codelibs.core.lang.StringUtil.isEmpty;
    import static org.codelibs.core.misc.AssertionUtil.assertArgumentNotEmpty;
    import static org.codelibs.core.misc.AssertionUtil.assertArgumentNotNull;
    
    import java.sql.Time;
    import java.util.Date;
    
    import org.codelibs.core.beans.Converter;
    import org.codelibs.core.convert.StringConversionUtil;
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/primitives/FloatsTest.java

      public void testStringConverter_convert() {
        Converter<String, Float> converter = Floats.stringConverter();
        assertThat(converter.convert("1.0")).isEqualTo((Float) 1.0f);
        assertThat(converter.convert("0.0")).isEqualTo((Float) 0.0f);
        assertThat(converter.convert("-1.0")).isEqualTo((Float) (-1.0f));
        assertThat(converter.convert("1")).isEqualTo((Float) 1.0f);
        assertThat(converter.convert("0")).isEqualTo((Float) 0.0f);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 29 15:43:06 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  9. internal/s3select/sql/value.go

    				a.setInt(iA)
    			} else if fA, ok := a.bytesToFloat(); ok {
    				a.setFloat(fA)
    			} else {
    				return fmt.Errorf("Could not convert %s to a number", a.String())
    			}
    
    		case bool:
    			if bA, ok := a.bytesToBool(); ok {
    				a.setBool(bA)
    			} else {
    				return fmt.Errorf("Could not convert %s to a boolean", a.String())
    			}
    
    		default:
    			return errCmpMismatchedTypes
    		}
    		return nil
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Feb 25 20:31:19 GMT 2022
    - 20.2K bytes
    - Viewed (0)
  10. docs/pt/docs/tutorial/header-params.md

    === "Python 3.10+"
    
        ```Python hl_lines="8"
        {!> ../../../docs_src/header_params/tutorial002_py310.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="10"
        {!> ../../../docs_src/header_params/tutorial002.py!}
        ```
    
    !!! warning "Aviso"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 3.9K bytes
    - Viewed (0)
Back to top