static std::string Sign(const std::string& secret_id,const std::string& secret_key,const std::string& http_method,const std::string& in_uri,const std::map<std::string, std::string>& headers,const std::map<std::string, std::string>& params);
매개변수 이름 | 매개변수 설명 | 유형 |
secret_id | 실명 인증을 위한 개발자 소유 프로젝트 ID | String |
secret_key | 개발자 소유 프로젝트 키 | String |
http_method | 전달될 때 대소문자를 구분하지 않는 POST/GET/HEAD/PUT 등 HTTP 메소드 | String |
in_uri | HTTP uri | String |
headers | HTTP header의 키 값 쌍 | string |
params | HTTP params의 키 값 쌍 | string |
static std::string Sign(const std::string& secret_id,const std::string& secret_key,const std::string& http_method,const std::string& in_uri,const std::map<std::string, std::string>& headers,const std::map<std::string, std::string>& params,uint64_t start_time_in_s,uint64_t end_time_in_s);
매개변수 이름 | 매개변수 설명 | 유형 |
secret_id | 실명 인증을 위한 개발자 소유 프로젝트 ID | String |
secret_key | 개발자 소유 프로젝트 키 | String |
http_method | 전달될 때 대소문자를 구분하지 않는 POST/GET/HEAD/PUT 등 HTTP 메소드 | String |
in_uri | HTTP uri | String |
headers | HTTP header의 키 값 쌍 | string |
params | HTTP params의 키 값 쌍 | string |
start_time_in_s | 서명 유효 기간의 시작 시간 | uint64_t |
end_time_in_s | 서명 유효 기간의 종료 시간 | uint64_t |
std::string GeneratePresignedUrl(const GeneratePresignedUrlReq& req)
매개변수 | 매개변수 설명 |
req | GeneratePresignedUrlReq, GeneratePresignedUrl 작업에 대한 요청 |
typedef enum {HTTP_HEAD,HTTP_GET,HTTP_PUT,HTTP_POST,HTTP_DELETE,HTTP_OPTIONS} HTTP_METHOD;
qcloud_cos::CosConfig config("./config.json");qcloud_cos::CosAPI cos(config);std::string bucket_name = "examplebucket-1250000000";std::string object_name = "exampleobject";// 버킷 이름, 객체 키, HTTP 요청 메소드를 추가합니다.qcloud_cos::GeneratePresignedUrlReq req(bucket_name, object_name, qcloud_cos::HTTP_GET);std::string presigned_url = cos.GeneratePresignedUrl(req);
피드백