Given a web page, I would like to detect:
http
request?http
method (POST
,
GET
, etc.) of the relevant request.I'm assuming this is a tough question.. but are there any indicators that could hint for one option or another?
The most common HTTP request methods have a call shortcut (such as http. get and http. post), but you can make any type of HTTP request by setting the call field to http. request and specifying the type of request using the method field.
let xhr = new XMLHttpRequest(); The xhr variable will now be the gateway to all the various properties and methods the XMLHttpRequest object provides for allowing us to make web requests.
What is HTTP? The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers. HTTP works as a request-response protocol between a client and server. Example: A client (browser) sends an HTTP request to the server; then the server returns a response to the client.
The list attribute in HTML is used to identify a list of pre-defined options for an <input> element to suggest the user. Usage: This attribute is used by the <input> element.
I would say any element having an attribute of type URI will be capable of trigerring an HTTP request, and also any element having an attribute if type script can trigger it through javascript.
We could filter that out from this list: https://www.w3.org/TR/REC-html40/index/attributes.html
and based on the accepted answer for this question: COMPLETE list of HTML tag attributes which have a URL value?
This gives you the list with attributes of type url (see my quoted answer below).
As for script type attributes, that includes onclick, onkeypress, etc which means, I believe you would be left with a hand full of elements which are not going to be able to trigger an http request if that.
Quoting the answer:
Check out the W3C's list of HTML attributes, there's a "type" column in there and just look for URI types.
And of course the HTML 5 version of that list is useful too
So for HTML4 we've got:
<a href=url>
<applet codebase=url>
<area href=url>
<base href=url>
<blockquote cite=url>
<body background=url>
<del cite=url>
<form action=url>
<frame longdesc=url>
and <frame src=url>
<head profile=url>
<iframe longdesc=url>
and <iframe src=url>
<img longdesc=url>
and <img src=url>
and <img usemap=url>
<input src=url>
and <input usemap=url>
<ins cite=url>
<link href=url>
<object classid=url>
and <object codebase=url>
and <object data=url>
and <object usemap=url>
<q cite=url>
<script src=url>
HTML 5 adds a few (and HTML5 seems to not use some of the ones above as well):
<audio src=url>
<button formaction=url>
<command icon=url>
<embed src=url>
<html manifest=url>
<input formaction=url>
<source src=url>
<video poster=url> and <video src=url>
These aren't necessarily simple URLs:
<object archive=url> or <object archive="url1 url2 url3">
<applet archive=url> or <applet archive=url1,url2,url3>
<meta http-equiv="refresh" content="seconds; url">
In addition, the style attribute can contain css declarations with one or several urls. For example: <div style="background: url(image.png)">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With