This topic describes the common parameters of Image Search API operations.

Common request parameters

Common request parameters refer to the parameters that need to be specified in an HTTP header for each API operation.
Parameter Type Required Description
Authorization String Yes The authentication information that is used to check the authenticity of requests. The string must follow the AccessKeyId:Signature format.
Content-Type String Yes The type of the content in the HTTP request. Set the value to application/x-www-form-urlencoded; charset=UTF-8.
Content-MD5 String Yes The 128-bit MD5 hash value of the HTTP message body. The hash value is encoded in Base64.
Date String Yes The specified Greenwich Mean Time (GMT) in HTTP 1.1, for example, Tue 9 Apr 2019 07:35:29 GMT.
Accept String Yes The required type of the values to return. Only application/json is supported.
x-acs-signature-nonce String Yes A unique, random number used to prevent replay attacks. You must use different random numbers for different requests.
x-acs-signature-method String Yes The encryption method of the signature string. Only HMAC-SHA1 is supported.
x-acs-version String Yes The version number of the API. The current version is 2019-03-25.

Examples

curl -X POST
     -H "date:Tue 9 Apr 2019 07:35:29 GMT"
     -H "authorization:acs AAAAAAAAAAAAAAAA:rvnQ7UtHSjyMIwo7kirUqAJZdPE="
     -H "content-md5:sc/d5c/HBOZdbMdjmaLiEg=="
     -H "content-type:application/x-www-form-urlencoded; charset=UTF-8"
     -H "x-acs-signature-method:HMAC-SHA1"
     -H "x-acs-signature-nonce:123212345678231234"
     -H "x-acs-version:2019-03-25"
     -H "accept:application/json"
     -d "InstanceName=demoinstance&PicName=demo&ProductId=demo&PicContent=..."
     "http://imagesearch.cn-shanghai.aliyuncs.com/v2/image/search"

Response parameters

The system returns a unique request ID for each API request, regardless of whether the request is successful. The following example is provided:
{
    "RequestId": "4C467B38-3910-447D-87BC-AC049166F216",
    /* Response data */
}