Hi,
I found this example in GitHub.
https://github.com/SkylineCommunications/SLC-C-Example_HTTP
after publishing and opening Dataminer Cube, I stuck during creating an element.
It's always asked for an IP-Address.
I wanted to execute the script to see how an HTTP-Connection works, but I don't know to run ?
Which IP-Address I need to put? Is there any list for default connections?
Thanks in advance!
Hello Omer,
IP address/host field refers to the IP of the device you want to poll, server is technically device as well, so in general when configuring HTTP you need to enter IP address of the device, you can also use URL. What this value will do is serve as domain name for url attribute values found in HTTP.Session.Connection.Request tag, meaning that url attribute value will get appended to you IP address value.
Now, in this specific example you can use Data Encoding page of the driver to query Wikipedia and because the url attribute is hard-coded it's irrelevant what you enter as IP address. For second part of the example you can set up your own machine to serve ProtocolSimulations/SLC SDF/HTTP/2.0.0.1/data.xml and then you can use localhost for IP address, in fact you can use localhost anyhow. I don't think it makes too much sense to setup your machine so I would advise you to use localhost as IP address and to play around with Data Encoding page. You should also make use of Stream Viewer to keep track of which request is being send and what is the response.
If you are interested in how HTTP works you should take a look at HTTP Element documentation and use HTTP tag in the protocol to see how it is implemented in practice. I would encourage you to try and play around, see if you can make requests to Google instead of Wiki, maybe you can change the connector so that IP address is taken in to account when sending a query via Data Encoding page.
Good luck and let me know if you need anything else,
Cheers
“If the specified value for the url attribute does not contain “://”, then it is assumed that the provided value is a relative URL, and the URL will be constructed using the polling IP and port of the corresponding connection.” So you are correct in both cases. If you specify relative path, you need to provide valid domain in element wizard(page that you screenshoted), and if you provide absolute path, you can write anything in IP address/host field and it won’t matter(it will matter if you have other connections that don’t use absolute path). You can see how this works by entering random value in IP address/host field, and then opening Stream Viewer. For Connection 1 you will see your request url looks like “yourvalue/http://anysssasw/ProtocolSimulations/SLC” (url gets cut short because of the space in it, this is quite an old example and needs a bit of love) and Connection 2 will just be “https://en.wikipedia.org?”. Connection 1 will trigger every 20s until the element times out, and Connection 2 can be triggered from Data Encoding page of the connector. You can use stream viewer(linked in comment above) to track requests and responses, not everything will be visible because of the use of HTTPS and because query parameter value is sent in the body of the request, if you use HTTP you should be able to see full request using network capture tool like Wireshark.
Thank you, it works for me now
I close this Question
Thanks for all this detailed information,
can u make an example ? Like if I have this URL:
https://operator.com/keycloak/auth/protocol/openid-connect/token (that’s the api call)
so in the HTTP session “Request verb=”GET” url=”keycloak/auth/protocol/openid-connect/token”>”
So the root “https://operator.com/” should be written in the Dataminercube ?
What if I write the full request in the session ? What address I need to write in the Dataminer Cube? (i can write random stuff just to avoid the error message?)
“Request verb=”GET” url=”https://operator.com/keycloak/auth/protocol/openid-connect/token”>” ?
And do you know any tool to check the requests they sent ?
Like, how can I see the request, and what get sent which data?
Thanks in advance