Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm at the moment making an angular webapplication with an REST api. I'm having a list of object which I request from my REST api. I've implemented a delete function to delete object from the list with a delete request. What I'd also like to implement is a check function which is able to check those objects before they are deleted if it is even possible to delete them but I don't know how to do this. Does anybody know how to write such a check function?
You'll need 'some other way' to communicate this type of information to a client. Your API could for instance just add a deletable property on the resource, determined by the server.
If you're looking for more of a standards approach, you could also implement an OPTIONS requests that returns an Allow header that contains a list of HTTP methods that the client may execute.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm in a full stack course and would like to use Django/Python to post/get my API calls, but use Javascript/Vue to stay on the same page. Can you still do that by essentially having a one page app that doesn't reload or change url? Just wondering before I go full on with it.
Also, what's a good way to use Javascript to get info onto the DOM from an API using an api key and secret key? I've experimented so much but haven't got back anything useful to my knowledge. Help is appreciated, thank you.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'd like to create an app to filter my notifications from Facebook. For example I'd like to get all notifications about someone commenting in conversations I also took part on given Facebook group.
As #lushn pointed out below, Facebook removed the ability to access notifications in their Graph API.
Now I wonder, is there a better (and more official) way to fetch notifications from Facebook than to pose as a browser and parse HTML (for that I'd also need a proxy written in some server language, due to CORS)?
Access to notifications is not possible anymore, the required permission and the endpoint for this has been removed with v2.4 of the Graph API: https://developers.facebook.com/docs/apps/changelog#v2_4
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have two ways to do it but I'm still weighing the options.
1st option : Using GET method to retrieve variables from the url.
2nd option : Using GET to retrieve the variables and post it to the url so that variables will be hidden.
Status Summary
I need this variable to execute my PHP function to display my table on the other page.
The only way to hide you variables is to store them on server side and use session to pass them between scripts.
POST variables are not hidden at all, there are many ways to reveal them.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I don't know if the fact that I'm using CS is relevant.
Anyway: I've defined some classes that I use to handle database objects, but I cannot find a clean way to pass the current user id (found in req.session.user.id) to them.
Is there a better way to achieve this than passing it every time as a parameter in the constructor?
In my case, I've build a very simple middleware to save some of the session data, some of my config data, etc. in the res.locals object so as to be able to obtain them in various modules. It depends what do you have in your classes: if you have access to the response object or not.
The middleware solution may be a good idea for you too
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want variables from my Javascript functions to be recorded in a database on my server and then posted back onto the html page. I know this may be easy with the POST and GET method, but I've been reading and I'm stumped. So if anyone could lead me to a sample that shows how to do this or show me here in an example of one that would help.
You need to use some form of server-side scripting language (such as PHP) to capture the data sent from JavaScript (presumably via means of AJAX's XMLHttpRequest object) and insert it in the database.
i.e.: There's no means of directly communicating with MySQL from JavaScript itself - you need to use a server-side scripting language to do this.
You might wanna read into Ajax which uses the XMLHttpRequest object to do exactly that.
Using this you can send data to and from a server side script. So that way you could "insert variables into database."