title: Azure python function Exception while executing function: Functions.HttpExample. System.Private.CoreLib: Result: Failure
body: <p>I have a azure python function. I am trying to post data to an API endpoint through my function. Below is the code I have for the same,</p>
  <pre><code>import logging
  import azure.functions as func
  def main(req: func.HttpRequest) -&gt; func.HttpResponse:
      logging.info('Python HTTP trigger function processed a request.')
      try:
          req_body = req.get_json()
          url = &quot;https://example.com/msgs&quot;
          payload= req.get_body()
          headers = {
          'Authorization': 'mytoken ',
          }
          response = func.HttpRequest(method=&quot;POST&quot;, url=url, headers=headers, body=payload,params=None,route_params=None) 
          return func.HttpResponse(&quot;&quot;, response)
      except :
          func.HttpResponse(
               &quot;This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.&quot;,
               status_code=200
          )
  </code></pre>
  <p>Every time I invoke my function, I get below error,</p>
  <pre><code>Executed 'Functions.HttpExample' (Failed, Id=bc8a184c-7b20-4946-a92c-ed2afad66e56, Duration=17ms)
  [2021-10-15T20:14:11.494Z] System.Private.CoreLib: Exception while executing function: Functions.HttpExample. System.Private.CoreLib: Result: Failure
  Exception: TypeError: unable to encode outgoing TypedData: unsupported type &quot;&lt;class 'azure.functions.http.HttpResponseConverter'&gt;&quot; for Python type &quot;NoneType&quot;
  Stack:   File &quot;C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9\WINDOWS\X64\azure_functions_worker\dispatcher.py&quot;, line 427, in _handle__invocation_request
      return_value = bindings.to_outgoing_proto(
    File &quot;C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9\WINDOWS\X64\azure_functions_worker\bindings\meta.py&quot;, line 116, in to_outgoing_proto
      datum = get_datum(binding, obj, pytype)
    File &quot;C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9\WINDOWS\X64\azure_functions_worker\bindings\meta.py&quot;, line 107, in get_datum
      raise TypeError(
  </code></pre>
  <p>Can anyone help me to fix this issue? or tell me a way to make a POST call from azure python function?</p>
  <p>Thanks,
  Tintu</p>