Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 848 for orjson (0.05 sec)

  1. fastapi/responses.py

        """
    
        def render(self, content: Any) -> bytes:
            assert orjson is not None, "orjson must be installed to use ORJSONResponse"
            return orjson.dumps(
                content, option=orjson.OPT_NON_STR_KEYS | orjson.OPT_SERIALIZE_NUMPY
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 18 12:36:40 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  2. docs_src/custom_response/tutorial009c.py

    from typing import Any
    
    import orjson
    from fastapi import FastAPI, Response
    
    app = FastAPI()
    
    
    class CustomORJSONResponse(Response):
        media_type = "application/json"
    
        def render(self, content: Any) -> bytes:
            assert orjson is not None, "orjson must be installed"
            return orjson.dumps(content, option=orjson.OPT_INDENT_2)
    
    
    @app.get("/", response_class=CustomORJSONResponse)
    async def main():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Sep 01 09:32:30 UTC 2022
    - 451 bytes
    - Viewed (0)
  3. tests/test_default_response_class.py

    from typing import Any
    
    import orjson
    from fastapi import APIRouter, FastAPI
    from fastapi.responses import HTMLResponse, JSONResponse, PlainTextResponse
    from fastapi.testclient import TestClient
    
    
    class ORJSONResponse(JSONResponse):
        media_type = "application/x-orjson"
    
        def render(self, content: Any) -> bytes:
            return orjson.dumps(content)
    
    
    class OverrideResponse(JSONResponse):
        media_type = "application/x-override"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Mar 01 20:49:20 UTC 2020
    - 5.2K bytes
    - Viewed (0)
  4. docs/em/docs/advanced/custom-response.md

    ## ๐Ÿ›ƒ ๐Ÿ“จ ๐ŸŽ“
    
    ๐Ÿ‘† ๐Ÿ’ช โœ ๐Ÿ‘† ๐Ÿ‘ ๐Ÿ›ƒ ๐Ÿ“จ ๐ŸŽ“, ๐Ÿ˜– โšช๏ธโžก๏ธ `Response` & โš™๏ธ โšซ๏ธ.
    
    ๐Ÿ–ผ, โžก๏ธ ๐Ÿ’ฌ ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿ’š โš™๏ธ <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a>, โœ‹๏ธ โฎ๏ธ ๐Ÿ›ƒ โš’ ๐Ÿšซ โš™๏ธ ๐Ÿ”Œ `ORJSONResponse` ๐ŸŽ“.
    
    โžก๏ธ ๐Ÿ’ฌ ๐Ÿ‘† ๐Ÿ’š โšซ๏ธ ๐Ÿ“จ ๐Ÿ”‚ &amp; ๐Ÿ“ ๐ŸŽป, ๐Ÿ‘† ๐Ÿ’š โš™๏ธ Orjson ๐ŸŽ› `orjson.OPT_INDENT_2`.
    
    ๐Ÿ‘† ๐Ÿ’ช โœ `CustomORJSONResponse`. ๐Ÿ‘‘ ๐Ÿ‘œ ๐Ÿ‘† โœ”๏ธ โœ `Response.render(content)` ๐Ÿ‘ฉโ€๐Ÿ”ฌ ๐Ÿ‘ˆ ๐Ÿ“จ ๐ŸŽš `bytes`:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.7K bytes
    - Viewed (0)
  5. docs/zh/docs/advanced/custom-response.md

    ### `JSONResponse`
    
    ๆŽฅๅ—ๆ•ฐๆฎๅนถ่ฟ”ๅ›žไธ€ไธช `application/json` ็ผ–็ ็š„ๅ“ๅบ”ใ€‚
    
    ๅฆ‚ไธŠๆ–‡ๆ‰€่ฟฐ๏ผŒ่ฟ™ๆ˜ฏ **FastAPI** ไธญไฝฟ็”จ็š„้ป˜่ฎคๅ“ๅบ”ใ€‚
    
    ### `ORJSONResponse`
    
    ๅฆ‚ไธŠๆ–‡ๆ‰€่ฟฐ๏ผŒ`ORJSONResponse` ๆ˜ฏไธ€ไธชไฝฟ็”จ <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> ็š„ๅฟซ้€Ÿ็š„ๅฏ้€‰ JSON ๅ“ๅบ”ใ€‚
    
    
    ### `UJSONResponse`
    
    `UJSONResponse` ๆ˜ฏไธ€ไธชไฝฟ็”จ <a href="https://github.com/ultrajson/ultrajson" class="external-link" target="_blank">`ujson`</a> ็š„ๅฏ้€‰ JSON ๅ“ๅบ”ใ€‚
    
    /// warning | "่ญฆๅ‘Š"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  6. requirements-tests.txt

    dirty-equals ==0.6.0
    sqlmodel==0.0.22
    flask >=1.1.2,<4.0.0
    anyio[trio] >=3.2.1,<4.0.0
    PyJWT==2.8.0
    pyyaml >=5.3.1,<7.0.0
    passlib[bcrypt] >=1.7.2,<2.0.0
    inline-snapshot==0.13.0
    # types
    types-ujson ==5.7.0.1
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Nov 01 11:17:12 UTC 2024
    - 333 bytes
    - Viewed (0)
  7. pyproject.toml

        "itsdangerous >=1.1.0",
        # For Starlette's schema generation, would not be used with FastAPI
        "pyyaml >=5.3.1",
        # For UJSONResponse
        "ujson >=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0",
        # For ORJSONResponse
        "orjson >=3.2.1",
        # To validate email fields
        "email-validator >=2.0.0",
        # Uvicorn with uvloop
        "uvicorn[standard] >=0.12.0",
        # Settings management
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 22 14:19:56 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  8. internal/logger/target/console/console.go

    func (c *Target) Send(e interface{}) error {
    	entry, ok := e.(log.Entry)
    	if !ok {
    		return fmt.Errorf("Uexpected log entry structure %#v", e)
    	}
    	if logger.IsJSON() {
    		logJSON, err := json.Marshal(&entry)
    		if err != nil {
    			return err
    		}
    		fmt.Fprintln(c.output, string(logJSON))
    		return nil
    	}
    
    	if entry.Level == logger.EventKind {
    		fmt.Fprintln(c.output, entry.Message)
    		return nil
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  9. src/main/java/org/codelibs/fess/app/web/api/admin/backup/ApiAdminBackupAction.java

        // GET /api/admin/backup/files
        @Execute
        public JsonResponse<ApiResult> files() {
            final List<Map<String, String>> list = getBackupItems();
            return asJson(new ApiBackupFilesResponse().files(list).total(list.size()).status(ApiResult.Status.OK).result());
        }
    
        // GET /api/admin/backup/file/{id}
        @Execute
        public StreamResponse get$file(final String id) {
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Sat Oct 12 01:54:15 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  10. src/main/java/org/codelibs/fess/app/web/api/admin/dict/protwords/ApiAdminDictProtwordsAction.java

            body.dictId = dictId;
            validateApi(body, messages -> {});
            final ProtwordsPager pager = copyBeanToNewBean(body, ProtwordsPager.class);
            return asJson(new ApiResult.ApiConfigsResponse<EditBody>()
                    .settings(protwordsService.getProtwordsList(body.dictId, pager).stream()
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Thu Feb 22 01:53:18 UTC 2024
    - 7.2K bytes
    - Viewed (0)
Back to top