I’m trying to set up an API GET method request using an external url. To do this, I need to set a username and password. The goal is to get the data and display it on my page.
Since a few days I’m trying to find documentation (as i’m not confident with this), but unfortunately I haven’t found anything that match. Can anybody explain or provide some good documentation or script example what is needed to setup it?
Do you have any information/documentation on the API you want to use? Usually using cfhttp is like doing curl, but you’ll have to translate all parameters needed by the API such as headers/forms/etc. to work with cfhttp. Take a look at this post just to check what I mean:
hi Zac thx for your reply. Unfortunately, it doesn’t work.
I get:
Unknown host: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Unable to determine MIME type of file.
username and password is correct because i tested in </> Rested Client of Firefox.
Hi Andreas, thank you for your reply. I have the response, structure and parameters.
In your post the they are using method post and i want to request data, so i should use get, correct?
Which you NEED to do. Upgrade to Java 8, preferably an OpenJDK build ( unless you’re paying Oracle for support )
Java 7 is way old. If you MUST run Java 7, you’re going to have issues with TLS1.2 being the minimum real soon, and your cacerts are old - both the one packaged with the old version of Lucee, and the one packaged with the Java 7 JVM.
I generated this one from Ubuntu Bionic as of today. Replace the one you have in your lucee folders with this one. cacerts (152.6 KB)