Hey, I’m hosting a python server that has a post request that needs to be sent.
This is how I’m sending the post request:
curl -X POST https://gemini-offline-knowledge.vercel.app/send -H "Content-Type: application/json; " -d '{"text": "The API worked!"}'
This is what I have in my python server:
app = Flask(__name__)
@app.route('/send/', methods=['POST'])
def send_sms():
pprint(request)
if request.is_json:
# send sms with whatever is in body
print (responseData)
print("Message sent successfully.")
return ('', 204)
if __name__ == "__main__":
app.run(debug=True)
this is what it returned:
<!doctype html>
<html lang=en>
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to the target URL: <a href="https://gemini-offline-knowledge.vercel.app/send/">https://gemini-offline-knowledge.vercel.app/send/</a>. If not, click the link.
My guess is there’s something additional I’d need to add to the headers.