locked
HTTPS POST - Error 400 Bad request Invalid verb RRS feed

  • Question

  • Hi,

    My application is getting the below response from the server when it does POST.

    "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
    <HTML><HEAD><TITLE>Bad Request</TITLE>
    <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
    <BODY><h2>Bad Request - Invalid Verb</h2>
    <hr><p>HTTP Error 400. The request verb is invalid.</p>
    </BODY></HTML>
    "

    It is a normal C application uses openssl(Not using Azure standard SDK).

    My POST request is as follows:

    "POST https://<myhost>.azure-devices.net/devices/Device001/messages/events?api-version=2016-02-03\niothub-to: /devices/Device001/messages/events\nAuthorization: SharedAccessSignature sr=<my sas token>\nAccept: application/json\nConnection: Keep-Alive\nUser-Agent: iothubclient/1.1.22 (Linux; x86_64), iothubclient/1.1.22 (Linux; x86_64)\nContent-Type: application/json\niothub-app-temperatureAlert: false\nHost:<myhost>.azure-devices.net\nContent-Length:83\n\n{"deviceId":"myFirstDevice","windSpeed":13.00,"temperature":26.00,"humidity":66.00}"

    Please help!

    Regards

    Tuesday, September 12, 2017 6:09 AM

All replies

  • Hey!  I was wondering if you ever found a solution to this issue?  I am currently experiencing the same error and hoping to learn from your experience.

    Thanks!

    Tuesday, October 9, 2018 7:57 PM