01-25-2020 09:51 AM
Hello,
I want to send a JSON via http put to a server. The first step was done with postman and it works as desired.
Now it's time to implement it in LabVIEW. The generation of the JSON already works. Currently I am stuck with sending the data.
What have I done so far.
I generate the necessary URL as I use it in postman and send the JSON (contained in the string buffer) with the http put vi. The following error message appears.
Because I have to include a local proxy I have added in front of the URL the following: http://localhost:3128/
With this change, the error message also changes to:
What I currently do not know:
Can you give me examples of how to communicate with a server that sends a JSON? Unfortunately I have not found anything in my search so far.
Thank you very much and best regards
Michael
01-25-2020 10:05 PM
With regards to proxies, you might find this thread useful: http through proxy connection
There's some code and discussion there by both the OP and rolfk, which might help. Otherwise, on the second page an NI staff member discusses CURL options via environment variables that can be used to control proxy behaviour.
With regards to your first question, looking at your included code images I'd say you'd be fine if you didn't need to use a proxy.
01-27-2020 10:13 AM
Thanks a lot for your help. How can I make the generated package, considting header, json, ... which will be send through the http put visible? I want to be sure, because in postman it is working, that I have configured everything right in labview.
Thanks a lot.
Best regards,
Michael
01-27-2020 02:31 PM
How is Postman configured? Is it configured to validate the server certificate or has than been disabled. You second error seems to indicate that your LabVIEW code is trying to verify the server certificate and it cannot. There is an optional "verify server" input on the "Open Handle" VI that defaults to True. Try setting this to false and see if it works. If it does and you need to actually verify the server you will need to start messing with certificates on your computer. Specifically, you will need the CA chain for the server's certificate.
01-28-2020 09:29 AM
Hello,
I use Px as local proxy. Px is a HTTP(s) proxy server that allows applications to authenticate through an NTLM or Kerberos proxy server, typically used in corporate deployments, without having to deal with the actual handshake. It is primarily designed to run on Windows systems and authenticates on behalf of the application using the currently logged in Windows user account. The advantage is that Px is able to use the currently logged in user's credentials automatically without requiring any user supplied credentials. This is accomplished by using Microsoft SSPI to generate the tokens and signatures required to authenticate with the proxy.
Testing with postman works. The LabVIEW Application ends up with error 363507.
Using Fiddler to compare both communications (LabVIEW vs. Postman) the main difference is, that postman uses https and labview not.
Any ideas?
Thanks for your help.