We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddc8298 commit 795ae72Copy full SHA for 795ae72
4-azure-functions-python-vscode/sentiment/__init__.py
@@ -5,7 +5,9 @@
5
def main(req: func.HttpRequest) -> func.HttpResponse:
6
analyzer = SentimentIntensityAnalyzer()
7
text = req.params.get("text")
8
+ if text is None:
9
+ return func.HttpResponse(status_code=302, headers={"Location":req.url+"?text=I+Love+PyCon"})
10
scores = analyzer.polarity_scores(text)
11
sentiment = "positive" if scores["compound"] > 0 else "negative"
12
return func.HttpResponse(sentiment)
-
13
+
0 commit comments