title: Trying to create a c++ PUT request with cURL with an object
body: <p>Recently I want to PUT an object with c++ curl.<br />
  Terminal command like this:</p>
  <pre><code>PUT /ObjectName HTTP/1.1
  Content-Length：ContentLength
  Content-Type: ContentType
  Host: BucketName.oss-cn-hangzhou.aliyuncs.com
  Date: GMT Date
  Authorization: SignatureValue
  </code></pre>
  <p>My code：</p>
  <pre><code>curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
  curl_easy_setopt(curl, CURLOPT_URL, &quot;https://tva******.oss*****.aliyuncs.com&quot;);
  curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
  curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size);
  auto size = to_string(file_info.st_size);
  curl_slist* headerList = NULL;
  headerList = curl_slist_append(headerList, (&quot;Authorization: &quot; + Authorization).c_str());
  headerList = curl_slist_append(headerList, (&quot;Date: &quot; + finalTime).c_str());
  headerList = curl_slist_append(headerList, (&quot;Content-Type: application/octet-stream&quot;));
  headerList = curl_slist_append(headerList, (&quot;Content-Length: &quot; + size).c_str());
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerList);
  res = curl_easy_perform(curl);
  </code></pre>
  <p>But its effect is <code>PUT HTTP/1.1</code> not <code>PUT /ObjectName HTTP/1.1</code>
  I want to put an object ,but there is no object, so it puts a bucket.
  How to make a request like <code>PUT /ObjectName HTTP/1.1</code>.</p>