I've a general (beginner) question about web programming. I'd like to display content graphically on a web page whose data is generated by a permanently running C++ program (in Qt).
For me, the first question is, which technologies do I need for this?
In my naivety I would now assume that the Qt program for generating data would have to run on a server with a fixed IP. It would also have to be able to connect via sockets.
The website would use a PHP script running on a web server, so that it would somehow communicate with the Qt program?
The C ++ executable application under Qt must save its data produced in a BDD Database
(or a file) on the web server side; and the web application (also running on the server), called
by the remote client web browser, will read these data in the DB (or in the file) for then
interpret / decode them then display them as graphics in the client browser.
For example in PHP, there are functions to access the mySQL database.
Under Qt, you can also access mySQL databases in C ++.
Other solutions :
- use (or design) a suitable PHP extension,
- call the executable C ++ program from PHP with the PHP function shell_exec ()
( see an example of "Serial COM port access in PHP" here: https://radiovibrations.com/techblog.php?i=10 )
I am using Kendo Grid in my application and need to implement better paging feature, sorting, Filtering,Groping and customization. Please share if anyone as implemented this feature already.
Every http request has a verb, that's just how http works, the verb lets the service know what action is being done, the theory being that you can use the same url to do different things. If you have the following endpoint
then calling it with GET will return product 5's data, calling it with DELETE will delete product 5 and so on. Because all requests have a verb you have to tell .net which verbs are valid for your method.
The word 'delete' doesn't even exist in the method. What's stopping me from calling it?
If you put a non-delete verb attribute on it then the framework will stop you calling it, it will return a 404. .net has two ways of associating methods with verbs, one is the explicit adding of the attributes which will restrict what can route to that action. It also follows a naming convention so you can put the verb at the start of the action name, so GetProduct, DeleteProduct etc and .net will use that to route your calls to the right method by matching the verb with the action prefix. You can choose to follow neither convention and use bespoke names and no verb attributes and the routing will (I assume) work on the action name only.
So the purpose they serve is that if you want to following proper semantic api conventions where you route your calls to actions based on the verb then the HttpXXX attributes allow you to implement that convention if you don't want to use the names themselves to route your methods.
If you put a non-delete verb attribute on it then the framework will stop you calling it, it will return a 404.
This is what's confusing to me. I have a Web API with NO verbs on it, and I can call it from my WPF app just fine. That's what got me posting this... what's the point of the verbs if I can create and call methods without them?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
It won't fail because he's suggesting calling that with HttpGet as the verb. Syntactically it's correct, but is not good practice.
I guess part of the answer is that historically, the HTTP verb played a more important part. Languages / frameworks were less flexible (or stricter?). There remain some practicalities - if you want to upload a 50Mb file, you don't want to use HttpGet because that would require the payload to be in the URL, and Http doesn't support URLs of that length. Your webserver may handle different verbs very differently, but where we're using IIS we can have ASP.Net handle different verbs - or ignore certain verbs - just how we want. For example, by default, IIS won't let you invoke a .ASMX webservice via HttpGet - but you can make a trivial change in web.config to allow it.
In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered "safe". This allows user agents to represent other methods, such as POST, PUT and DELETE, in a special way, so that the user is made aware of the fact that a possibly unsafe action is being requested.
Interestingly, the implication is that the end user is aware of the HTTP verbs being used in an interaction - again, a throwback to a time when internet use was the preserve of techs working at protocol level.
In short, then, the answer to the original question is simply: it's convention.
Last Visit: 31-Dec-99 19:00 Last Update: 22-Feb-24 14:51