tcl curl

Clovertech Forums Cloverleaf tcl curl

  • Creator
    Topic
  • #118386
    David Speare
    Participant

      Hello All  –

       

      Trying to do a simple exercise and I don’t see what i’m not seeing.  This is a post to an azure service bus endpoint

      script:

      package require TclCurl

      set verbose 4
      set curlHandle [curl::init]
      set URL {myendpoint.servicebus.windows.net/}
      set httpHeaders {{ContentType: application/atom+xml;type=entry;charset=utf-8} {User-Agent “CIS”} {Authorization: SharedAccessSignature sr=http%3a%2f%2fe<REMOVED>sig=<REMOVED>&se=<REMOVED>&skn=RootManageSharedAccessKey} }

      set msg [read [open /data/cloverleaf/cis19.1/integrator/s_adt1/data/20210114_servicebustest.json r]]

      ::curl::transfer -url $URL -bodyvar html -post 1 -postfields $msg -httpheader $httpHeaders

       

       

      The script isn’t throwing an error, but my endpoint isn’t registering that it was received.  I’ve tried different ways, but can’t get a return value to echo out for me.

       

      Thanks for the help –

    Viewing 1 reply thread
    • Author
      Replies
      • #118387
        Tipu Razaq
        Participant

          Can you try using curl from the command prompt instead of TCL to see if there’s a difference?

           

          curl -v -X POST -H  “<HEADERS GO HERE>” myendpoint.servicebus.windows.net/ -d @/data/cloverleaf/cis19.1/integrator/s_adt1/data/20210114_servicebustest.json

        • #118388
          Charlie Bursell
          Participant

            Try something like this at the end and see what results you get
            (From the Curl example)

            set totalTime [ $curlHandle getinfo totaltime ]
            set connectTime [ $curlHandle getinfo connecttime ]
            set sizeDownload [ $curlHandle getinfo sizedownload ]
            set speedDownoad [ $curlHandle getinfo speeddownload ]
            puts ” totalTime = $totalTime ”
            puts ” connectTime = $connectTime ”
            puts ” sizeDownload = $sizeDownload ”
            puts ” speedDownoad = $speedDownoad ”

             

            Also should add this to the end of your script just to be complete
            $curlHandle cleanup

        Viewing 1 reply thread
        • You must be logged in to reply to this topic.