Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #11573

Re: vbscript post to REST API HELP

Newsgroups microsoft.public.scripting.vbscript
Date 2017-02-23 04:54 -0800
References <ee2f9787-86db-422c-b0ee-7b4b47b8c070@googlegroups.com> <XnsA724EB08D5443eejj99@194.109.6.166> <3be13017-79f8-442f-9f0b-96af64b2328f@googlegroups.com> <XnsA7256E3E58F40eejj99@194.109.6.166>
Message-ID <308d9bc2-eeea-4ba3-aec0-0c74340c8221@googlegroups.com> (permalink)
Subject Re: vbscript post to REST API HELP
From Scot Needy <scotrn@gmail.com>

Show all headers | View raw


On Thursday, February 23, 2017 at 4:50:17 AM UTC-5, Evertjan. wrote:
> Scot Needy <scotrn@gmail.com> wrote on 23 Feb 2017 in
> microsoft.public.scripting.vbscript: 
> 
> > Thanks Evertjan I caught that after I posted. So many changes just to
> > try and get this working. 
> > 
> > Still getting 80004005 "unspecified error" I suspect it has something to
> > do with the Msxml2.ServerXMLHTTP methods i'm using but I'm having
> > trouble finding good examples. 
> [..] 
> > strJSONToSend = "{aligned_resource"": ""/device/17653"", ""message"":
> > ""Taskname Failed""}" 
> 
> strJSONToSend = "{""aligned_resource"":.....
> 
> But probably, that is not what thows the error.
> 
> Please start by debugging, programming in breakpoints, etc.
> 
> We should not do this testing for you.
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

Evertjan, 

Your correction is not what I posted and does not address the error as you stated. 
Your assuming I'm just throwing this out there without debugging ?  I'm reaching out because I have spent the last 20+ hours trying to get a simple curl one line into vbs.  

My problem was the base64 encoded string I created it had encoded the ":" and gave me 2 incorrect characters in the string.  I changed it to what I captured and the code now works but needs error checking.  
I tried getting and example I saw to dynamically encode but failed completely. 
Removed credentials from the open statement and using the encoded string only. 
xmlhttp.open "POST", url, false 
xmlhttp.setRequestHeader "Authorization", "Basic ******encoded string****" 
xmlhttp.setRequestHeader "Content-Type", "application/json"
xmlhttp.send(strJSONToSend)


Anyone have good working example of error condition checks ?  I've tried all the ones I found on Google.   

Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

vbscript post to REST API   HELP scotrn@gmail.com - 2017-02-22 12:17 -0800
  Re: vbscript post to REST API   HELP "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-22 23:06 +0100
    Re: vbscript post to REST API   HELP Scot Needy <scotrn@gmail.com> - 2017-02-22 17:14 -0800
      Re: vbscript post to REST API   HELP Scot Needy <scotrn@gmail.com> - 2017-02-22 21:22 -0800
        Re: vbscript post to REST API   HELP JJ <jj4public@vfemail.net> - 2017-02-24 08:20 +0700
          Re: vbscript post to REST API   HELP Scot Needy <scotrn@gmail.com> - 2017-02-23 20:03 -0800
      Re: vbscript post to REST API   HELP "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-23 10:50 +0100
        Re: vbscript post to REST API   HELP Scot Needy <scotrn@gmail.com> - 2017-02-23 04:54 -0800
          Re: vbscript post to REST API   HELP "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-23 14:06 +0100
            Re: vbscript post to REST API   HELP Scot Needy <scotrn@gmail.com> - 2017-02-23 09:10 -0800
              Re: vbscript post to REST API   HELP "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-23 20:02 +0100
              Re: vbscript post to REST API   HELP "Mayayana" <mayayana@invalid.nospam> - 2017-02-23 17:19 -0500
                Re: vbscript post to REST API   HELP Scot Needy <scotrn@gmail.com> - 2017-02-23 19:32 -0800
                Re: vbscript post to REST API   HELP "Mayayana" <mayayana@invalid.nospam> - 2017-02-23 23:07 -0500
                Re: vbscript post to REST API   HELP "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-24 09:17 +0100
                Re: vbscript post to REST API   HELP "Mayayana" <mayayana@invalid.nospam> - 2017-02-24 10:22 -0500
  Re: vbscript post to REST API   HELP davidjsmith10@gmail.com - 2020-01-13 09:15 -0800

csiph-web