I have a visualforce which is just used to send the Json data when we make a callout to the page with some parameters passed in the URL.
Error is showing in the following line. Please help in get through this issue.

2 Answers
2

Performing any DML during a page's action method is a security concern. This is because people can cause your code to run without the user's consent. For example, consider what happens if someone puts this HTML into an email, or a page on a website, etc:

<img src="https://na1.visual.force.com/apex/MyPage?id=12345" />

Even though no image will appear, the damage has already been done: your DML was performed by the user without them even knowing anything's happened. At minimum, you should consider calling the method after the page loads. Even better, you should warn the user and give them a chance to back out.

So basically the already posted answer addressed your problem? It would be more useful to the community if you instead accept that answer by clicking on the check mark/tick to the left of the answer, turning it green. This marks the question as resolved to your satisfaction, and awards reputation both to you and the person who answered.
– Adrian Larson♦Sep 28 '16 at 13:38