Ankündigung

Einklappen
Keine Ankündigung bisher.

HTTP POST Header

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • HTTP POST Header

    Hello,
    Does anyone know how we can control the header data of an HTTP POST virtual output command?

    Virtual Output - Address field contains; the hostname
    Virtual Output Command - Command for ON field contains; /restoftheTargetAPIURI
    Virtual Output Command - HTTP Post command for ON contains;
    Authorization: Bearer 6fd2c9f940c0f3243c3d1b3d1bb9e76\r
    Content-Type: application/json\r
    \r
    {"mode":"sync", "messageType":"0f8453105c3b9faf7886", "messages":[{"celcius":29.3, "humidity":59.9, "timestamp":"2017-01-15T11:55:37.930Z"}]}

    Anyone a better suggestion to be able to determine the header data?
    Thanks for your help!

  • #2
    Put your HTTP headers into the "HTTP extensions for ON" field.
    Put the HTTP body into the "HTTP Post command for ON" field
    Make sure the HTTP method is set correctly - i.e. PUT/POST/GET

    Because there are multple headers, separate them with a "\r\n" - i.e instead of a single carriage-return, try using carriage-return followed by line-feed character. And you don't need the CR/LF at the end of the header field. Try doing this:

    HTTP extensions for ON:
    Authorization: Bearer 6fd2c9f940c0f3243c3d1b3d1bb9e76\r\nContent-Type: application/json

    HTTP Post command for ON:
    {"mode":"sync", "messageType":"0f8453105c3b9faf7886", "messages":[{"celcius":29.3, "humidity":59.9, "timestamp":"2017-01-15T11:55:37.930Z"}]}

    Command for ON:
    /restoftheTargetAPIURI

    Kommentar

    Lädt...
    X