can someone provide an example how to work with Zabbix API from Delphi?
Which Delphi component to use?
Thanks
Basically, the whole Zabbix API is just a JSON-RPC API, accessible via POST calls on one single URL. Further details about API can be found here:
https://www.zabbix.com/documentation/2.4/manual/api
As can be seen, the only thing you have to do is to make a POST to:
http://company.com/zabbix/api_jsonrpc.php HTTP/1.1
Content-Type: application/json-rpc
{"jsonrpc":"2.0","method":"apiinfo.version","id":1,"auth":null,"params":{}}
Now, it does not matter whether you use delphi or not, you only need a component that can build a HTTP request and parse HTTP respone. I found this question, that may be helpful for you, since it seems to handle HTTP POSTs in Delphi.
What’s the simplest way to call Http POST url using Delphi?
At this time, i don't know any existing Delphi library that would do the magic for you.
Related
it's probably I pretty dumb question but I just can't find any information online on how to do this. Probably I'm googling the wrong stuff.
I have to do 2 things. Send xml files via XMLHTTPRequests to a given Server. That's not a problem and easily done. But the company I'm working with also wants me to provide a Server that can receive XMLHTTPRequests and saves them into a file which I can then work with.
How do I handle this? Does I have to setup e.g. NGINX to do this or is this just a specific website I have to host? When I google for XMLHTTPRequests I only find how to send or get data but not how to setup the Server Side. I really have no clue.
Hope you can send me the right way so I can finally continue to work on this.
ty :)
You need a web server server side to receive requests from XMLHTTPRequest calls. You could set up NGINX to do this, or use any web server that you want.
This isn't usually covered in the documentation because you need to serve the page that contains the JavaScript with the XMLHTTPRequest from some server. To get to the point where you are making a XMLHTTPRequest, you already need some HTTP server set up and working. You would usually configure the page to be served from some a main URL like https://example.com/ and have the XMLHTTPRequest call to another URL like https://example.com/log-data would have you logic for storing to a file like your requirement.
I’m trying to get and print the HTTP protocol version of the target in requests made by vue-resource in a Vue.js component. I don’t have any problem in getting headers like Data or Server: being on localhost I use a proxy to bypass the CORS limitations as well, but I can’t figure out how to do the same with that. As far as I know, both Chrome and Firefox developer tools refer to the HTTP protocol version in the request (not in the response), so using response.headers.get("foo"); as explained in the official documentation doesn’t work, and I don’t have a request variable set. I just need to show if the target uses HTTP 1.x or 2.x in a string like HTTP/1.1 200 OK — I can’t understand if Vue.http.interceptors could help and how. I guess it shouldn’t be that hard… thanks in advance!
EDIT: Unrelated to Vue.js itself, but resource.nextHopProtocol did the trick — on Firefox, at least. Being a Candidate Recommendation, it doesn’t work with all the browsers.
I'm coding an app in PHP and I've had issues starting a tag subscription when I don't use HTTPS, I've tested both ways and would prefer to use HTTP if possible.
Has anyone else run into this and know of a solution?
Their documentation doesn't show the need for https. When I use HTTP I get the error
Unable to reach callback URL "http://...
My issue wasn't https vs http. It was my function that curls the post data. I rebuilt it and it works now.
A note for future people trying to use the Realtime API it returns zero data about the Instagram post which I find odd, why note include a post id at the very least. All it currently does is ping your server with data about your subscription effected. Its also worth noting to see that data you have to use this command in PHP
$igdata = file_get_contents("php://input");
if I get data from an external website in JSONP form, how do I access the http header response? I have heard this may be difficult but my experience is that everything is possible.
Nope.
This is completely impossible.
The whole point of JSONP is to bypass the same-origin policy by passing a result through executable Javascript code.
Other than JS code generated by the remote server, you cannot get any information.
Could someone show me an example or a starting point on how Dropbox api http requests should look?
For example if I want to receive tokens how would the HTTP/1.1 request look like for this?
I'm planning on writing a program in C using sockets,
write(sockfd,buffer,strlen(buffer));
What should buffer look like to receive security tokens from dropbox? I hope I'm making sense.
The official SDKs on the Dropbox developer site each include working examples that you can work from:
https://www.dropbox.com/developers/reference/sdk