Announcement

Collapse
No announcement yet.

hs.URLAction PUT request not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Try changing:

    httpWebRequest.GetRequestStream()

    to:

    httpWebRequest.GetRequestStream().ToString

    and the same for the GetResponseStream()
    Jon

    Comment


      #17
      Originally posted by jon00 View Post
      Try changing:

      httpWebRequest.GetRequestStream()

      to:

      httpWebRequest.GetRequestStream().ToString

      and the same for the GetResponseStream()
      Great, thanks Jon, that did it!

      Cheers
      Al
      HS 4.2.8.0: 2134 Devices 1252 Events
      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

      Comment


        #18
        Originally posted by jon00 View Post
        Try changing:

        httpWebRequest.GetRequestStream()

        to:

        httpWebRequest.GetRequestStream().ToString

        and the same for the GetResponseStream()
        I'm also using the above code to POST json to a Microsoft Azure IoT Hub.

        If I run the script in tenscripting it works and I know the headers and content get sent to the hub as i can see the data arriving using IoT Device explorer.

        However if i run script on my homeseer machine itself, I get the errors described above. If I apply your suggested fix of adding the .ToString suffix, the errors go away but the body of my POST doesn't get sent - yet the headers do.

        any thoughts? perhaps a separate thread?

        Comment


          #19
          Im getting the same type of errors.

          Comment


            #20
            update:
            I've lifted the code from Sparkmans example posted here:
            https://forums.homeseer.com/showthre...0358&styleid=1

            And i'm now able to post json data to An Azure IoT Hub without errors.

            Thanks.

            Comment


              #21
              Originally posted by ecuboss View Post
              update:
              I've lifted the code from Sparkmans example posted here:
              https://forums.homeseer.com/showthre...0358&styleid=1

              And i'm now able to post json data to An Azure IoT Hub without errors.

              Thanks.
              Great!
              HS 4.2.8.0: 2134 Devices 1252 Events
              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

              Comment

              Working...
              X