Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 4,982 for from (0.16 sec)

  1. tests/test_serialize_response.py

    from typing import List, Optional
    
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: Optional[float] = None
        owner_ids: Optional[List[int]] = None
    
    
    @app.get("/items/valid", response_model=Item)
    def get_valid():
        return {"name": "valid", "price": 1.0}
    
    
    @app.get("/items/coerce", response_model=Item)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Aug 03 12:29:07 GMT 2020
    - 1.4K bytes
    - Viewed (0)
  2. docs_src/query_params_str_validations/tutorial012_an.py

    from typing import List
    
    from fastapi import FastAPI, Query
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[List[str], Query()] = ["foo", "bar"]):
        query_items = {"q": q}
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 262 bytes
    - Viewed (0)
  3. docs_src/security/tutorial006_an.py

    from fastapi import Depends, FastAPI
    from fastapi.security import HTTPBasic, HTTPBasicCredentials
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    security = HTTPBasic()
    
    
    @app.get("/users/me")
    def read_current_user(credentials: Annotated[HTTPBasicCredentials, Depends(security)]):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 371 bytes
    - Viewed (0)
  4. docs_src/security/tutorial003.py

    from typing import Union
    
    from fastapi import Depends, FastAPI, HTTPException, status
    from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
    from pydantic import BaseModel
    
    fake_users_db = {
        "johndoe": {
            "username": "johndoe",
            "full_name": "John Doe",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret",
            "disabled": False,
        },
        "alice": {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 2.4K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_websockets/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.websockets.tutorial003 import app, html
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/")
        assert response.text == html
    
    
    def test_websocket_handle_disconnection():
        with client.websocket_connect("/ws/1234") as connection, client.websocket_connect(
            "/ws/5678"
        ) as connection_two:
            connection.send_text("Hello from 1234")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 29 09:26:07 GMT 2021
    - 872 bytes
    - Viewed (0)
  6. docs_src/security/tutorial005_py310.py

    from datetime import datetime, timedelta, timezone
    
    from fastapi import Depends, FastAPI, HTTPException, Security, status
    from fastapi.security import (
        OAuth2PasswordBearer,
        OAuth2PasswordRequestForm,
        SecurityScopes,
    )
    from jose import JWTError, jwt
    from passlib.context import CryptContext
    from pydantic import BaseModel, ValidationError
    
    # to get a string like this run:
    # openssl rand -hex 32
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  7. internal/handlers/proxy.go

    	protoRegex = regexp.MustCompile(`(?i)^(;|,| )+(?:proto=)(https|http)`)
    )
    
    // GetSourceScheme retrieves the scheme from the X-Forwarded-Proto and RFC7239
    // Forwarded headers (in that order).
    func GetSourceScheme(r *http.Request) string {
    	var scheme string
    
    	// Retrieve the scheme from X-Forwarded-Proto.
    	if proto := r.Header.Get(xForwardedProto); proto != "" {
    		scheme = strings.ToLower(proto)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Dec 22 00:56:55 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  8. android/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java

        final Bound to;
        final Bound from;
        final K firstInclusive;
        final K lastInclusive;
        private final Comparator<Entry<K, V>> entryComparator;
    
        public SortedMapSubmapTestMapGenerator(
            TestSortedMapGenerator<K, V> delegate, Bound to, Bound from) {
          super(delegate);
          this.to = to;
          this.from = from;
    
          SortedMap<K, V> emptyMap = delegate.create();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 18.2K bytes
    - Viewed (0)
  9. docs_src/body/tutorial003.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 09 14:28:58 GMT 2024
    - 362 bytes
    - Viewed (0)
  10. guava-testlib/src/com/google/common/collect/testing/SortedSetTestSuiteBuilder.java

        features.remove(CollectionFeature.ALLOWS_NULL_VALUES);
        features.add(CollectionFeature.SUBSET_VIEW);
    
        return newBuilderUsing(delegate, to, from)
            .named(parentBuilder.getName() + " subSet " + from + "-" + to)
            .withFeatures(features)
            .suppressing(parentBuilder.getSuppressedTests())
            .withSetUp(parentBuilder.getSetUp())
            .withTearDown(parentBuilder.getTearDown())
            .createTestSuite();
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Feb 26 19:46:10 GMT 2024
    - 4.2K bytes
    - Viewed (0)
Back to top