Created
August 6, 2019 11:09
-
-
Save naxty/df936ed23f33f68e594e586cd4ad3adf to your computer and use it in GitHub Desktop.
Example of fast api post request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import APIRouter, Depends | |
api = APIRouter() | |
@api.post("/predict", response_model=PredictionResult) | |
def post_predict( | |
housing_features: HousingFeatures, | |
authenticated: bool = Depends(security.validate_request), | |
): | |
assert authenticated == True | |
return predict(housing_features) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment