htmlgtmetrix

How to send a post request to GTMetrix


I want my users to write his website on my site and then be sent to gtmetrix.com to start a new test, but without needing to write his website again.

I am trying with this:

<form method="post" action="https://gtmetrix.com/analyze.html">
<input type="text" placeholder="Enter your Website URL"></input>
<input type="submit">CHECK IT</input>
</form>

But i get a

Analysis Error

You tried to analyze an invalid/malformed URL

What i am doing wrong? is possible to do this?


Solution

  • It seems they require the url in the form data field called url.

    You must use the following input tag:

    <input type="url" name="url" value="" placeholder="Enter your website URL" maxlength="1024" autofocus="" required="">
    

    Also, they could be blocking external referrers. But first try adding the name attribute.