I have the following metohd inside my asp.net mvc web application, which calls an external API, bypassing an authentication token inside the authntication header :-
try
{
string currentURL = System.Web.Configuration.WebConfigurationManager.AppSettings["scanningURL"];
string token = System.Web.Configuration.WebConfigurationManager.AppSettings["TMSToken"];
using (WebClient wc = new WebClient())
{
string url = currentURL + "home/scanserver?FQDN=allscan" ;
wc.Headers.Add("Authorization",
token);
var json = await wc.DownloadStringTaskAsync(url);
TempData["messagePartial"] = string.Format("Scan has been completed. Scan reported generated");
}
}
now is this considered more secure if i send Post request instead of Get request as i am currently doing, or they have the same security level ?
second question which is about semantic . now this request is for Network Scanning , where the Network Scanning will modify the DB with the scanning result. so should I in all cases use Post request instead of Get,, since the request will modify the database , or in other words will call another action method that will modify the DB ? Thanks