title: FastAPI {"detail":"Method Not Allowed"}
body: <p>I am using FAST API for my ML Model.</p>
  <p>I have a pipeline.</p>
  <pre class="lang-py prettyprint-override"><code>lr_tfidf = Pipeline([('vect', tfidf),
                       ('clf', LogisticRegression(penalty='l2'))])
  
  
  </code></pre>
  <p>Now In Fast API, when I want to predict, and display result as API, my code is</p>
  <pre class="lang-py prettyprint-override"><code>app = FastAPI()
  
  
  @app.post('/predict')
  def predict_species(data: str):
      data = np.array([data])
  
      prob = lr_tfidf.predict_proba(data).max()
      pred = lr_tfidf.predict(data)
      return {'Probability': f'{prob}', 
              'Predictions':f'{pred}'}
  </code></pre>
  <p>I copied it from a tutorial. When I test it on GUI by FASTAPI, it works good as shown in Image, i.e it shows probability and predictions.</p>
  <p><a href="https://i.stack.imgur.com/4VPtz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4VPtz.png" alt="enter image description here" /></a></p>
  <p>When I go to request URL, as provided by the GUI, which is <code>http://127.0.0.1:8000/predict?data=hello</code> (test data is hello) It gives me error.</p>
  <pre class="lang-py prettyprint-override"><code>{&quot;detail&quot;:&quot;Method Not Allowed&quot;}
  </code></pre>
  <p>On my Terminal, the error message is</p>
  <pre class="lang-py prettyprint-override"><code>INFO:     127.0.0.1:42568 - &quot;GET /predict?data=hello HTTP/1.1&quot; 405 Method Not Allowed
  </code></pre>