Scot Needy <
sco...@gmail.com> wrote on 23 Feb 2017 in
microsoft.public.scripting.vbscript:
> On Thursday, February 23, 2017 at 4:50:17 AM UTC-5, Evertjan. wrote:
>> Scot Needy <
sco...@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.
[please do not quote signatures on usenet, signature removed]
> 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 ?
Well, what else could I assume
if you do not give the fact and the the results of your 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.
That is rather a different story, isn't it?
Did you give the code for that creation?
> 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.
Why would it need error-checking if it works?
Please specify what error[s] you expect to catch.
> 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.
See above.