📅  最后修改于: 2023-12-03 14:40:17.220000             🧑  作者: Mango
CSS Minifier API is a web service that helps developers efficiently minify their CSS code. This API provides a simple and easy-to-use interface for developers to pass in their CSS code and receive the minified version in response.
To get started with the CSS Minifier API, sign up for an API key on the website. Once you have an API key, you can start using the API by making HTTP GET or POST requests.
The following parameters can be included in the request:
The response returned by the CSS Minifier API will be in JSON format and will contain the following fields:
Request:
curl https://api.cssminifier.com/sapi.cgi \
-d "input=#menu a { color: #fff; text-decoration: none; }"
Response:
{
"success": true,
"message": "OK",
"result": "#menu a{color:#fff;text-decoration:none}"
}
Request:
curl https://api.cssminifier.com/sapi.cgi \
-F "input=@example.css" \
-F "dataType=css"
Response:
{
"success": true,
"message": "OK",
"result": ".test{color:red;font-weight:bold}"
}
Using the CSS Minifier API, developers can easily minify their CSS code and optimize their website's performance. The lightweight and fast nature of this API makes it an ideal solution for developers who want to streamline their development process. Get started today by signing up for an API key!