Cloud Storage JSON API
DELETE
storage.bucketAccessControls.delete
{{baseUrl}}/b/:bucket/acl/:entity
QUERY PARAMS
bucket
entity
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/acl/:entity");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/b/:bucket/acl/:entity")
require "http/client"
url = "{{baseUrl}}/b/:bucket/acl/:entity"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/acl/:entity"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/acl/:entity");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/acl/:entity"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/b/:bucket/acl/:entity HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/b/:bucket/acl/:entity")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/acl/:entity"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl/:entity")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/b/:bucket/acl/:entity")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/b/:bucket/acl/:entity');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/b/:bucket/acl/:entity'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/acl/:entity';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/acl/:entity',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl/:entity")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/acl/:entity',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'DELETE', url: '{{baseUrl}}/b/:bucket/acl/:entity'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/b/:bucket/acl/:entity');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'DELETE', url: '{{baseUrl}}/b/:bucket/acl/:entity'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/acl/:entity';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/acl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/acl/:entity" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/acl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/b/:bucket/acl/:entity');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/acl/:entity');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/acl/:entity');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/acl/:entity' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/acl/:entity' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/b/:bucket/acl/:entity")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/acl/:entity"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/acl/:entity"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/acl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/b/:bucket/acl/:entity') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/acl/:entity";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/b/:bucket/acl/:entity
http DELETE {{baseUrl}}/b/:bucket/acl/:entity
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/b/:bucket/acl/:entity
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/acl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.bucketAccessControls.get
{{baseUrl}}/b/:bucket/acl/:entity
QUERY PARAMS
bucket
entity
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/acl/:entity");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/acl/:entity")
require "http/client"
url = "{{baseUrl}}/b/:bucket/acl/:entity"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/acl/:entity"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/acl/:entity");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/acl/:entity"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/acl/:entity HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/acl/:entity")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/acl/:entity"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl/:entity")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/acl/:entity")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/acl/:entity');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/acl/:entity'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/acl/:entity';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/acl/:entity',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl/:entity")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/acl/:entity',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/acl/:entity'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/acl/:entity');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/acl/:entity'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/acl/:entity';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/acl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/acl/:entity" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/acl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/acl/:entity');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/acl/:entity');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/acl/:entity');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/acl/:entity' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/acl/:entity' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/acl/:entity")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/acl/:entity"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/acl/:entity"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/acl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/acl/:entity') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/acl/:entity";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/acl/:entity
http GET {{baseUrl}}/b/:bucket/acl/:entity
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/acl/:entity
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/acl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.bucketAccessControls.insert
{{baseUrl}}/b/:bucket/acl
QUERY PARAMS
bucket
BODY json
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/acl");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b/:bucket/acl" {:content-type :json
:form-params {:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:id ""
:kind ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/acl"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/acl"),
Content = new StringContent("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/acl");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/acl"
payload := strings.NewReader("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b/:bucket/acl HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 219
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b/:bucket/acl")
.setHeader("content-type", "application/json")
.setBody("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/acl"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b/:bucket/acl")
.header("content-type", "application/json")
.body("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.asString();
const data = JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b/:bucket/acl');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/acl',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/acl';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/acl',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/acl',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/acl',
headers: {'content-type': 'application/json'},
body: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b/:bucket/acl');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/acl',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/acl';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bucket": @"",
@"domain": @"",
@"email": @"",
@"entity": @"",
@"entityId": @"",
@"etag": @"",
@"id": @"",
@"kind": @"",
@"projectTeam": @{ @"projectNumber": @"", @"team": @"" },
@"role": @"",
@"selfLink": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/acl"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/acl" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/acl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b/:bucket/acl', [
'body' => '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/acl');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/acl');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/acl' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/acl' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/b/:bucket/acl", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/acl"
payload = {
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/acl"
payload <- "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/acl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/b/:bucket/acl') do |req|
req.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/acl";
let payload = json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/b/:bucket/acl \
--header 'content-type: application/json' \
--data '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
echo '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}' | \
http POST {{baseUrl}}/b/:bucket/acl \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/acl
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/acl")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.bucketAccessControls.list
{{baseUrl}}/b/:bucket/acl
QUERY PARAMS
bucket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/acl");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/acl")
require "http/client"
url = "{{baseUrl}}/b/:bucket/acl"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/acl"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/acl");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/acl"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/acl HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/acl")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/acl"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/acl")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/acl');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/acl'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/acl';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/acl',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/acl',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/acl'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/acl');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/acl'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/acl';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/acl"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/acl" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/acl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/acl');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/acl');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/acl');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/acl' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/acl' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/acl")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/acl"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/acl"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/acl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/acl') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/acl";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/acl
http GET {{baseUrl}}/b/:bucket/acl
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/acl
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/acl")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PATCH
storage.bucketAccessControls.patch
{{baseUrl}}/b/:bucket/acl/:entity
QUERY PARAMS
bucket
entity
BODY json
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/acl/:entity");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/b/:bucket/acl/:entity" {:content-type :json
:form-params {:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:id ""
:kind ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/acl/:entity"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/acl/:entity"),
Content = new StringContent("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/acl/:entity");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/acl/:entity"
payload := strings.NewReader("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/b/:bucket/acl/:entity HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 219
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/b/:bucket/acl/:entity")
.setHeader("content-type", "application/json")
.setBody("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/acl/:entity"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl/:entity")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/b/:bucket/acl/:entity")
.header("content-type", "application/json")
.body("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.asString();
const data = JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/b/:bucket/acl/:entity');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/acl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/acl/:entity';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/acl/:entity',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl/:entity")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/acl/:entity',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/acl/:entity',
headers: {'content-type': 'application/json'},
body: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/b/:bucket/acl/:entity');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/acl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/acl/:entity';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bucket": @"",
@"domain": @"",
@"email": @"",
@"entity": @"",
@"entityId": @"",
@"etag": @"",
@"id": @"",
@"kind": @"",
@"projectTeam": @{ @"projectNumber": @"", @"team": @"" },
@"role": @"",
@"selfLink": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/acl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/acl/:entity" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/acl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/b/:bucket/acl/:entity', [
'body' => '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/acl/:entity');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/acl/:entity');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/acl/:entity' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/acl/:entity' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/b/:bucket/acl/:entity", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/acl/:entity"
payload = {
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/acl/:entity"
payload <- "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/acl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/b/:bucket/acl/:entity') do |req|
req.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/acl/:entity";
let payload = json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/b/:bucket/acl/:entity \
--header 'content-type: application/json' \
--data '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
echo '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}' | \
http PATCH {{baseUrl}}/b/:bucket/acl/:entity \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/acl/:entity
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/acl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
storage.bucketAccessControls.update
{{baseUrl}}/b/:bucket/acl/:entity
QUERY PARAMS
bucket
entity
BODY json
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/acl/:entity");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/b/:bucket/acl/:entity" {:content-type :json
:form-params {:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:id ""
:kind ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/acl/:entity"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/acl/:entity"),
Content = new StringContent("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/acl/:entity");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/acl/:entity"
payload := strings.NewReader("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/b/:bucket/acl/:entity HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 219
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/b/:bucket/acl/:entity")
.setHeader("content-type", "application/json")
.setBody("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/acl/:entity"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl/:entity")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/b/:bucket/acl/:entity")
.header("content-type", "application/json")
.body("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.asString();
const data = JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/b/:bucket/acl/:entity');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/acl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/acl/:entity';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/acl/:entity',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/acl/:entity")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/acl/:entity',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/acl/:entity',
headers: {'content-type': 'application/json'},
body: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/b/:bucket/acl/:entity');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/acl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/acl/:entity';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bucket": @"",
@"domain": @"",
@"email": @"",
@"entity": @"",
@"entityId": @"",
@"etag": @"",
@"id": @"",
@"kind": @"",
@"projectTeam": @{ @"projectNumber": @"", @"team": @"" },
@"role": @"",
@"selfLink": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/acl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/acl/:entity" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/acl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/b/:bucket/acl/:entity', [
'body' => '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/acl/:entity');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/acl/:entity');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/acl/:entity' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/acl/:entity' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/b/:bucket/acl/:entity", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/acl/:entity"
payload = {
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/acl/:entity"
payload <- "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/acl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/b/:bucket/acl/:entity') do |req|
req.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/acl/:entity";
let payload = json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/b/:bucket/acl/:entity \
--header 'content-type: application/json' \
--data '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
echo '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}' | \
http PUT {{baseUrl}}/b/:bucket/acl/:entity \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/acl/:entity
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/acl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
storage.buckets.delete
{{baseUrl}}/b/:bucket
QUERY PARAMS
bucket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/b/:bucket")
require "http/client"
url = "{{baseUrl}}/b/:bucket"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/b/:bucket"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/b/:bucket HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/b/:bucket")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/b/:bucket")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/b/:bucket');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/b/:bucket'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'DELETE', url: '{{baseUrl}}/b/:bucket'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/b/:bucket');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'DELETE', url: '{{baseUrl}}/b/:bucket'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/b/:bucket');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/b/:bucket")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/b/:bucket') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/b/:bucket
http DELETE {{baseUrl}}/b/:bucket
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/b/:bucket
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.buckets.get
{{baseUrl}}/b/:bucket
QUERY PARAMS
bucket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket")
require "http/client"
url = "{{baseUrl}}/b/:bucket"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket
http GET {{baseUrl}}/b/:bucket
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.buckets.getIamPolicy
{{baseUrl}}/b/:bucket/iam
QUERY PARAMS
bucket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/iam");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/iam")
require "http/client"
url = "{{baseUrl}}/b/:bucket/iam"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/iam"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/iam");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/iam"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/iam HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/iam")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/iam"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/iam")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/iam")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/iam');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/iam'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/iam';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/iam',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/iam")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/iam',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/iam'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/iam');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/iam'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/iam';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/iam"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/iam" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/iam",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/iam');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/iam');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/iam');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/iam' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/iam' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/iam")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/iam"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/iam"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/iam")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/iam') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/iam";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/iam
http GET {{baseUrl}}/b/:bucket/iam
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/iam
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/iam")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.buckets.insert
{{baseUrl}}/b
QUERY PARAMS
project
BODY json
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b?project=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b" {:query-params {:project ""}
:content-type :json
:form-params {:acl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:id ""
:kind ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:autoclass {:enabled false
:toggleTime ""}
:billing {:requesterPays false}
:cors [{:maxAgeSeconds 0
:method []
:origin []
:responseHeader []}]
:customPlacementConfig {:dataLocations []}
:defaultEventBasedHold false
:defaultObjectAcl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:encryption {:defaultKmsKeyName ""}
:etag ""
:iamConfiguration {:bucketPolicyOnly {:enabled false
:lockedTime ""}
:publicAccessPrevention ""
:uniformBucketLevelAccess {:enabled false
:lockedTime ""}}
:id ""
:kind ""
:labels {}
:lifecycle {:rule [{:action {:storageClass ""
:type ""}
:condition {:age 0
:createdBefore ""
:customTimeBefore ""
:daysSinceCustomTime 0
:daysSinceNoncurrentTime 0
:isLive false
:matchesPattern ""
:matchesPrefix []
:matchesStorageClass []
:matchesSuffix []
:noncurrentTimeBefore ""
:numNewerVersions 0}}]}
:location ""
:locationType ""
:logging {:logBucket ""
:logObjectPrefix ""}
:metageneration ""
:name ""
:owner {:entity ""
:entityId ""}
:projectNumber ""
:retentionPolicy {:effectiveTime ""
:isLocked false
:retentionPeriod ""}
:rpo ""
:satisfiesPZS false
:selfLink ""
:storageClass ""
:timeCreated ""
:updated ""
:versioning {:enabled false}
:website {:mainPageSuffix ""
:notFoundPage ""}}})
require "http/client"
url = "{{baseUrl}}/b?project="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b?project="),
Content = new StringContent("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b?project=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b?project="
payload := strings.NewReader("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b?project= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2438
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b?project=")
.setHeader("content-type", "application/json")
.setBody("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b?project="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b?project=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b?project=")
.header("content-type", "application/json")
.body("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
autoclass: {
enabled: false,
toggleTime: ''
},
billing: {
requesterPays: false
},
cors: [
{
maxAgeSeconds: 0,
method: [],
origin: [],
responseHeader: []
}
],
customPlacementConfig: {
dataLocations: []
},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
encryption: {
defaultKmsKeyName: ''
},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {
enabled: false,
lockedTime: ''
},
publicAccessPrevention: '',
uniformBucketLevelAccess: {
enabled: false,
lockedTime: ''
}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {
storageClass: '',
type: ''
},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {
logBucket: '',
logObjectPrefix: ''
},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
projectNumber: '',
retentionPolicy: {
effectiveTime: '',
isLocked: false,
retentionPeriod: ''
},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {
enabled: false
},
website: {
mainPageSuffix: '',
notFoundPage: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b?project=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/b',
params: {project: ''},
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b?project=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"autoclass":{"enabled":false,"toggleTime":""},"billing":{"requesterPays":false},"cors":[{"maxAgeSeconds":0,"method":[],"origin":[],"responseHeader":[]}],"customPlacementConfig":{"dataLocations":[]},"defaultEventBasedHold":false,"defaultObjectAcl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"encryption":{"defaultKmsKeyName":""},"etag":"","iamConfiguration":{"bucketPolicyOnly":{"enabled":false,"lockedTime":""},"publicAccessPrevention":"","uniformBucketLevelAccess":{"enabled":false,"lockedTime":""}},"id":"","kind":"","labels":{},"lifecycle":{"rule":[{"action":{"storageClass":"","type":""},"condition":{"age":0,"createdBefore":"","customTimeBefore":"","daysSinceCustomTime":0,"daysSinceNoncurrentTime":0,"isLive":false,"matchesPattern":"","matchesPrefix":[],"matchesStorageClass":[],"matchesSuffix":[],"noncurrentTimeBefore":"","numNewerVersions":0}}]},"location":"","locationType":"","logging":{"logBucket":"","logObjectPrefix":""},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"projectNumber":"","retentionPolicy":{"effectiveTime":"","isLocked":false,"retentionPeriod":""},"rpo":"","satisfiesPZS":false,"selfLink":"","storageClass":"","timeCreated":"","updated":"","versioning":{"enabled":false},"website":{"mainPageSuffix":"","notFoundPage":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b?project=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "autoclass": {\n "enabled": false,\n "toggleTime": ""\n },\n "billing": {\n "requesterPays": false\n },\n "cors": [\n {\n "maxAgeSeconds": 0,\n "method": [],\n "origin": [],\n "responseHeader": []\n }\n ],\n "customPlacementConfig": {\n "dataLocations": []\n },\n "defaultEventBasedHold": false,\n "defaultObjectAcl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "encryption": {\n "defaultKmsKeyName": ""\n },\n "etag": "",\n "iamConfiguration": {\n "bucketPolicyOnly": {\n "enabled": false,\n "lockedTime": ""\n },\n "publicAccessPrevention": "",\n "uniformBucketLevelAccess": {\n "enabled": false,\n "lockedTime": ""\n }\n },\n "id": "",\n "kind": "",\n "labels": {},\n "lifecycle": {\n "rule": [\n {\n "action": {\n "storageClass": "",\n "type": ""\n },\n "condition": {\n "age": 0,\n "createdBefore": "",\n "customTimeBefore": "",\n "daysSinceCustomTime": 0,\n "daysSinceNoncurrentTime": 0,\n "isLive": false,\n "matchesPattern": "",\n "matchesPrefix": [],\n "matchesStorageClass": [],\n "matchesSuffix": [],\n "noncurrentTimeBefore": "",\n "numNewerVersions": 0\n }\n }\n ]\n },\n "location": "",\n "locationType": "",\n "logging": {\n "logBucket": "",\n "logObjectPrefix": ""\n },\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "projectNumber": "",\n "retentionPolicy": {\n "effectiveTime": "",\n "isLocked": false,\n "retentionPeriod": ""\n },\n "rpo": "",\n "satisfiesPZS": false,\n "selfLink": "",\n "storageClass": "",\n "timeCreated": "",\n "updated": "",\n "versioning": {\n "enabled": false\n },\n "website": {\n "mainPageSuffix": "",\n "notFoundPage": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b?project=")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b?project=',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/b',
qs: {project: ''},
headers: {'content-type': 'application/json'},
body: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b');
req.query({
project: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
autoclass: {
enabled: false,
toggleTime: ''
},
billing: {
requesterPays: false
},
cors: [
{
maxAgeSeconds: 0,
method: [],
origin: [],
responseHeader: []
}
],
customPlacementConfig: {
dataLocations: []
},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
encryption: {
defaultKmsKeyName: ''
},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {
enabled: false,
lockedTime: ''
},
publicAccessPrevention: '',
uniformBucketLevelAccess: {
enabled: false,
lockedTime: ''
}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {
storageClass: '',
type: ''
},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {
logBucket: '',
logObjectPrefix: ''
},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
projectNumber: '',
retentionPolicy: {
effectiveTime: '',
isLocked: false,
retentionPeriod: ''
},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {
enabled: false
},
website: {
mainPageSuffix: '',
notFoundPage: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/b',
params: {project: ''},
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b?project=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"autoclass":{"enabled":false,"toggleTime":""},"billing":{"requesterPays":false},"cors":[{"maxAgeSeconds":0,"method":[],"origin":[],"responseHeader":[]}],"customPlacementConfig":{"dataLocations":[]},"defaultEventBasedHold":false,"defaultObjectAcl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"encryption":{"defaultKmsKeyName":""},"etag":"","iamConfiguration":{"bucketPolicyOnly":{"enabled":false,"lockedTime":""},"publicAccessPrevention":"","uniformBucketLevelAccess":{"enabled":false,"lockedTime":""}},"id":"","kind":"","labels":{},"lifecycle":{"rule":[{"action":{"storageClass":"","type":""},"condition":{"age":0,"createdBefore":"","customTimeBefore":"","daysSinceCustomTime":0,"daysSinceNoncurrentTime":0,"isLive":false,"matchesPattern":"","matchesPrefix":[],"matchesStorageClass":[],"matchesSuffix":[],"noncurrentTimeBefore":"","numNewerVersions":0}}]},"location":"","locationType":"","logging":{"logBucket":"","logObjectPrefix":""},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"projectNumber":"","retentionPolicy":{"effectiveTime":"","isLocked":false,"retentionPeriod":""},"rpo":"","satisfiesPZS":false,"selfLink":"","storageClass":"","timeCreated":"","updated":"","versioning":{"enabled":false},"website":{"mainPageSuffix":"","notFoundPage":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"acl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"id": @"", @"kind": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ],
@"autoclass": @{ @"enabled": @NO, @"toggleTime": @"" },
@"billing": @{ @"requesterPays": @NO },
@"cors": @[ @{ @"maxAgeSeconds": @0, @"method": @[ ], @"origin": @[ ], @"responseHeader": @[ ] } ],
@"customPlacementConfig": @{ @"dataLocations": @[ ] },
@"defaultEventBasedHold": @NO,
@"defaultObjectAcl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"generation": @"", @"id": @"", @"kind": @"", @"object": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ],
@"encryption": @{ @"defaultKmsKeyName": @"" },
@"etag": @"",
@"iamConfiguration": @{ @"bucketPolicyOnly": @{ @"enabled": @NO, @"lockedTime": @"" }, @"publicAccessPrevention": @"", @"uniformBucketLevelAccess": @{ @"enabled": @NO, @"lockedTime": @"" } },
@"id": @"",
@"kind": @"",
@"labels": @{ },
@"lifecycle": @{ @"rule": @[ @{ @"action": @{ @"storageClass": @"", @"type": @"" }, @"condition": @{ @"age": @0, @"createdBefore": @"", @"customTimeBefore": @"", @"daysSinceCustomTime": @0, @"daysSinceNoncurrentTime": @0, @"isLive": @NO, @"matchesPattern": @"", @"matchesPrefix": @[ ], @"matchesStorageClass": @[ ], @"matchesSuffix": @[ ], @"noncurrentTimeBefore": @"", @"numNewerVersions": @0 } } ] },
@"location": @"",
@"locationType": @"",
@"logging": @{ @"logBucket": @"", @"logObjectPrefix": @"" },
@"metageneration": @"",
@"name": @"",
@"owner": @{ @"entity": @"", @"entityId": @"" },
@"projectNumber": @"",
@"retentionPolicy": @{ @"effectiveTime": @"", @"isLocked": @NO, @"retentionPeriod": @"" },
@"rpo": @"",
@"satisfiesPZS": @NO,
@"selfLink": @"",
@"storageClass": @"",
@"timeCreated": @"",
@"updated": @"",
@"versioning": @{ @"enabled": @NO },
@"website": @{ @"mainPageSuffix": @"", @"notFoundPage": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b?project="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b?project=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b?project=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'autoclass' => [
'enabled' => null,
'toggleTime' => ''
],
'billing' => [
'requesterPays' => null
],
'cors' => [
[
'maxAgeSeconds' => 0,
'method' => [
],
'origin' => [
],
'responseHeader' => [
]
]
],
'customPlacementConfig' => [
'dataLocations' => [
]
],
'defaultEventBasedHold' => null,
'defaultObjectAcl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'encryption' => [
'defaultKmsKeyName' => ''
],
'etag' => '',
'iamConfiguration' => [
'bucketPolicyOnly' => [
'enabled' => null,
'lockedTime' => ''
],
'publicAccessPrevention' => '',
'uniformBucketLevelAccess' => [
'enabled' => null,
'lockedTime' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'lifecycle' => [
'rule' => [
[
'action' => [
'storageClass' => '',
'type' => ''
],
'condition' => [
'age' => 0,
'createdBefore' => '',
'customTimeBefore' => '',
'daysSinceCustomTime' => 0,
'daysSinceNoncurrentTime' => 0,
'isLive' => null,
'matchesPattern' => '',
'matchesPrefix' => [
],
'matchesStorageClass' => [
],
'matchesSuffix' => [
],
'noncurrentTimeBefore' => '',
'numNewerVersions' => 0
]
]
]
],
'location' => '',
'locationType' => '',
'logging' => [
'logBucket' => '',
'logObjectPrefix' => ''
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'projectNumber' => '',
'retentionPolicy' => [
'effectiveTime' => '',
'isLocked' => null,
'retentionPeriod' => ''
],
'rpo' => '',
'satisfiesPZS' => null,
'selfLink' => '',
'storageClass' => '',
'timeCreated' => '',
'updated' => '',
'versioning' => [
'enabled' => null
],
'website' => [
'mainPageSuffix' => '',
'notFoundPage' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b?project=', [
'body' => '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'project' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'autoclass' => [
'enabled' => null,
'toggleTime' => ''
],
'billing' => [
'requesterPays' => null
],
'cors' => [
[
'maxAgeSeconds' => 0,
'method' => [
],
'origin' => [
],
'responseHeader' => [
]
]
],
'customPlacementConfig' => [
'dataLocations' => [
]
],
'defaultEventBasedHold' => null,
'defaultObjectAcl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'encryption' => [
'defaultKmsKeyName' => ''
],
'etag' => '',
'iamConfiguration' => [
'bucketPolicyOnly' => [
'enabled' => null,
'lockedTime' => ''
],
'publicAccessPrevention' => '',
'uniformBucketLevelAccess' => [
'enabled' => null,
'lockedTime' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'lifecycle' => [
'rule' => [
[
'action' => [
'storageClass' => '',
'type' => ''
],
'condition' => [
'age' => 0,
'createdBefore' => '',
'customTimeBefore' => '',
'daysSinceCustomTime' => 0,
'daysSinceNoncurrentTime' => 0,
'isLive' => null,
'matchesPattern' => '',
'matchesPrefix' => [
],
'matchesStorageClass' => [
],
'matchesSuffix' => [
],
'noncurrentTimeBefore' => '',
'numNewerVersions' => 0
]
]
]
],
'location' => '',
'locationType' => '',
'logging' => [
'logBucket' => '',
'logObjectPrefix' => ''
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'projectNumber' => '',
'retentionPolicy' => [
'effectiveTime' => '',
'isLocked' => null,
'retentionPeriod' => ''
],
'rpo' => '',
'satisfiesPZS' => null,
'selfLink' => '',
'storageClass' => '',
'timeCreated' => '',
'updated' => '',
'versioning' => [
'enabled' => null
],
'website' => [
'mainPageSuffix' => '',
'notFoundPage' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'autoclass' => [
'enabled' => null,
'toggleTime' => ''
],
'billing' => [
'requesterPays' => null
],
'cors' => [
[
'maxAgeSeconds' => 0,
'method' => [
],
'origin' => [
],
'responseHeader' => [
]
]
],
'customPlacementConfig' => [
'dataLocations' => [
]
],
'defaultEventBasedHold' => null,
'defaultObjectAcl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'encryption' => [
'defaultKmsKeyName' => ''
],
'etag' => '',
'iamConfiguration' => [
'bucketPolicyOnly' => [
'enabled' => null,
'lockedTime' => ''
],
'publicAccessPrevention' => '',
'uniformBucketLevelAccess' => [
'enabled' => null,
'lockedTime' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'lifecycle' => [
'rule' => [
[
'action' => [
'storageClass' => '',
'type' => ''
],
'condition' => [
'age' => 0,
'createdBefore' => '',
'customTimeBefore' => '',
'daysSinceCustomTime' => 0,
'daysSinceNoncurrentTime' => 0,
'isLive' => null,
'matchesPattern' => '',
'matchesPrefix' => [
],
'matchesStorageClass' => [
],
'matchesSuffix' => [
],
'noncurrentTimeBefore' => '',
'numNewerVersions' => 0
]
]
]
],
'location' => '',
'locationType' => '',
'logging' => [
'logBucket' => '',
'logObjectPrefix' => ''
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'projectNumber' => '',
'retentionPolicy' => [
'effectiveTime' => '',
'isLocked' => null,
'retentionPeriod' => ''
],
'rpo' => '',
'satisfiesPZS' => null,
'selfLink' => '',
'storageClass' => '',
'timeCreated' => '',
'updated' => '',
'versioning' => [
'enabled' => null
],
'website' => [
'mainPageSuffix' => '',
'notFoundPage' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/b');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'project' => ''
]));
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b?project=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b?project=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/b?project=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b"
querystring = {"project":""}
payload = {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": False,
"toggleTime": ""
},
"billing": { "requesterPays": False },
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": { "dataLocations": [] },
"defaultEventBasedHold": False,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": { "defaultKmsKeyName": "" },
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": False,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": False,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": { "rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": False,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
] },
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": False,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": False,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": { "enabled": False },
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b"
queryString <- list(project = "")
payload <- "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b?project=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/b') do |req|
req.params['project'] = ''
req.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b";
let querystring = [
("project", ""),
];
let payload = json!({
"acl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"autoclass": json!({
"enabled": false,
"toggleTime": ""
}),
"billing": json!({"requesterPays": false}),
"cors": (
json!({
"maxAgeSeconds": 0,
"method": (),
"origin": (),
"responseHeader": ()
})
),
"customPlacementConfig": json!({"dataLocations": ()}),
"defaultEventBasedHold": false,
"defaultObjectAcl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"encryption": json!({"defaultKmsKeyName": ""}),
"etag": "",
"iamConfiguration": json!({
"bucketPolicyOnly": json!({
"enabled": false,
"lockedTime": ""
}),
"publicAccessPrevention": "",
"uniformBucketLevelAccess": json!({
"enabled": false,
"lockedTime": ""
})
}),
"id": "",
"kind": "",
"labels": json!({}),
"lifecycle": json!({"rule": (
json!({
"action": json!({
"storageClass": "",
"type": ""
}),
"condition": json!({
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": (),
"matchesStorageClass": (),
"matchesSuffix": (),
"noncurrentTimeBefore": "",
"numNewerVersions": 0
})
})
)}),
"location": "",
"locationType": "",
"logging": json!({
"logBucket": "",
"logObjectPrefix": ""
}),
"metageneration": "",
"name": "",
"owner": json!({
"entity": "",
"entityId": ""
}),
"projectNumber": "",
"retentionPolicy": json!({
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
}),
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": json!({"enabled": false}),
"website": json!({
"mainPageSuffix": "",
"notFoundPage": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/b?project=' \
--header 'content-type: application/json' \
--data '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}'
echo '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}' | \
http POST '{{baseUrl}}/b?project=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "autoclass": {\n "enabled": false,\n "toggleTime": ""\n },\n "billing": {\n "requesterPays": false\n },\n "cors": [\n {\n "maxAgeSeconds": 0,\n "method": [],\n "origin": [],\n "responseHeader": []\n }\n ],\n "customPlacementConfig": {\n "dataLocations": []\n },\n "defaultEventBasedHold": false,\n "defaultObjectAcl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "encryption": {\n "defaultKmsKeyName": ""\n },\n "etag": "",\n "iamConfiguration": {\n "bucketPolicyOnly": {\n "enabled": false,\n "lockedTime": ""\n },\n "publicAccessPrevention": "",\n "uniformBucketLevelAccess": {\n "enabled": false,\n "lockedTime": ""\n }\n },\n "id": "",\n "kind": "",\n "labels": {},\n "lifecycle": {\n "rule": [\n {\n "action": {\n "storageClass": "",\n "type": ""\n },\n "condition": {\n "age": 0,\n "createdBefore": "",\n "customTimeBefore": "",\n "daysSinceCustomTime": 0,\n "daysSinceNoncurrentTime": 0,\n "isLive": false,\n "matchesPattern": "",\n "matchesPrefix": [],\n "matchesStorageClass": [],\n "matchesSuffix": [],\n "noncurrentTimeBefore": "",\n "numNewerVersions": 0\n }\n }\n ]\n },\n "location": "",\n "locationType": "",\n "logging": {\n "logBucket": "",\n "logObjectPrefix": ""\n },\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "projectNumber": "",\n "retentionPolicy": {\n "effectiveTime": "",\n "isLocked": false,\n "retentionPeriod": ""\n },\n "rpo": "",\n "satisfiesPZS": false,\n "selfLink": "",\n "storageClass": "",\n "timeCreated": "",\n "updated": "",\n "versioning": {\n "enabled": false\n },\n "website": {\n "mainPageSuffix": "",\n "notFoundPage": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/b?project='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"acl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"autoclass": [
"enabled": false,
"toggleTime": ""
],
"billing": ["requesterPays": false],
"cors": [
[
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
]
],
"customPlacementConfig": ["dataLocations": []],
"defaultEventBasedHold": false,
"defaultObjectAcl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"encryption": ["defaultKmsKeyName": ""],
"etag": "",
"iamConfiguration": [
"bucketPolicyOnly": [
"enabled": false,
"lockedTime": ""
],
"publicAccessPrevention": "",
"uniformBucketLevelAccess": [
"enabled": false,
"lockedTime": ""
]
],
"id": "",
"kind": "",
"labels": [],
"lifecycle": ["rule": [
[
"action": [
"storageClass": "",
"type": ""
],
"condition": [
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
]
]
]],
"location": "",
"locationType": "",
"logging": [
"logBucket": "",
"logObjectPrefix": ""
],
"metageneration": "",
"name": "",
"owner": [
"entity": "",
"entityId": ""
],
"projectNumber": "",
"retentionPolicy": [
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
],
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": ["enabled": false],
"website": [
"mainPageSuffix": "",
"notFoundPage": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b?project=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.buckets.list
{{baseUrl}}/b
QUERY PARAMS
project
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b?project=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b" {:query-params {:project ""}})
require "http/client"
url = "{{baseUrl}}/b?project="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b?project="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b?project=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b?project="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b?project= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b?project=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b?project="))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b?project=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b?project=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b?project=');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/b', params: {project: ''}};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b?project=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b?project=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b?project=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b?project=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/b', qs: {project: ''}};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b');
req.query({
project: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/b', params: {project: ''}};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b?project=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b?project="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b?project=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b?project=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b?project=');
echo $response->getBody();
setUrl('{{baseUrl}}/b');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'project' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'project' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b?project=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b?project=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b?project=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b"
querystring = {"project":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b"
queryString <- list(project = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b?project=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b') do |req|
req.params['project'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b";
let querystring = [
("project", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/b?project='
http GET '{{baseUrl}}/b?project='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/b?project='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b?project=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.buckets.lockRetentionPolicy
{{baseUrl}}/b/:bucket/lockRetentionPolicy
QUERY PARAMS
ifMetagenerationMatch
bucket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b/:bucket/lockRetentionPolicy" {:query-params {:ifMetagenerationMatch ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/lockRetentionPolicy',
params: {ifMetagenerationMatch: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/lockRetentionPolicy',
qs: {ifMetagenerationMatch: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b/:bucket/lockRetentionPolicy');
req.query({
ifMetagenerationMatch: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/lockRetentionPolicy',
params: {ifMetagenerationMatch: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/lockRetentionPolicy');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'ifMetagenerationMatch' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/lockRetentionPolicy');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'ifMetagenerationMatch' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/lockRetentionPolicy"
querystring = {"ifMetagenerationMatch":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/lockRetentionPolicy"
queryString <- list(ifMetagenerationMatch = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/b/:bucket/lockRetentionPolicy') do |req|
req.params['ifMetagenerationMatch'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/lockRetentionPolicy";
let querystring = [
("ifMetagenerationMatch", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch='
http POST '{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/lockRetentionPolicy?ifMetagenerationMatch=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PATCH
storage.buckets.patch
{{baseUrl}}/b/:bucket
QUERY PARAMS
bucket
BODY json
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/b/:bucket" {:content-type :json
:form-params {:acl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:id ""
:kind ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:autoclass {:enabled false
:toggleTime ""}
:billing {:requesterPays false}
:cors [{:maxAgeSeconds 0
:method []
:origin []
:responseHeader []}]
:customPlacementConfig {:dataLocations []}
:defaultEventBasedHold false
:defaultObjectAcl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:encryption {:defaultKmsKeyName ""}
:etag ""
:iamConfiguration {:bucketPolicyOnly {:enabled false
:lockedTime ""}
:publicAccessPrevention ""
:uniformBucketLevelAccess {:enabled false
:lockedTime ""}}
:id ""
:kind ""
:labels {}
:lifecycle {:rule [{:action {:storageClass ""
:type ""}
:condition {:age 0
:createdBefore ""
:customTimeBefore ""
:daysSinceCustomTime 0
:daysSinceNoncurrentTime 0
:isLive false
:matchesPattern ""
:matchesPrefix []
:matchesStorageClass []
:matchesSuffix []
:noncurrentTimeBefore ""
:numNewerVersions 0}}]}
:location ""
:locationType ""
:logging {:logBucket ""
:logObjectPrefix ""}
:metageneration ""
:name ""
:owner {:entity ""
:entityId ""}
:projectNumber ""
:retentionPolicy {:effectiveTime ""
:isLocked false
:retentionPeriod ""}
:rpo ""
:satisfiesPZS false
:selfLink ""
:storageClass ""
:timeCreated ""
:updated ""
:versioning {:enabled false}
:website {:mainPageSuffix ""
:notFoundPage ""}}})
require "http/client"
url = "{{baseUrl}}/b/:bucket"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/b/:bucket"),
Content = new StringContent("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket"
payload := strings.NewReader("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/b/:bucket HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2438
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/b/:bucket")
.setHeader("content-type", "application/json")
.setBody("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/b/:bucket")
.header("content-type", "application/json")
.body("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
autoclass: {
enabled: false,
toggleTime: ''
},
billing: {
requesterPays: false
},
cors: [
{
maxAgeSeconds: 0,
method: [],
origin: [],
responseHeader: []
}
],
customPlacementConfig: {
dataLocations: []
},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
encryption: {
defaultKmsKeyName: ''
},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {
enabled: false,
lockedTime: ''
},
publicAccessPrevention: '',
uniformBucketLevelAccess: {
enabled: false,
lockedTime: ''
}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {
storageClass: '',
type: ''
},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {
logBucket: '',
logObjectPrefix: ''
},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
projectNumber: '',
retentionPolicy: {
effectiveTime: '',
isLocked: false,
retentionPeriod: ''
},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {
enabled: false
},
website: {
mainPageSuffix: '',
notFoundPage: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/b/:bucket');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"autoclass":{"enabled":false,"toggleTime":""},"billing":{"requesterPays":false},"cors":[{"maxAgeSeconds":0,"method":[],"origin":[],"responseHeader":[]}],"customPlacementConfig":{"dataLocations":[]},"defaultEventBasedHold":false,"defaultObjectAcl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"encryption":{"defaultKmsKeyName":""},"etag":"","iamConfiguration":{"bucketPolicyOnly":{"enabled":false,"lockedTime":""},"publicAccessPrevention":"","uniformBucketLevelAccess":{"enabled":false,"lockedTime":""}},"id":"","kind":"","labels":{},"lifecycle":{"rule":[{"action":{"storageClass":"","type":""},"condition":{"age":0,"createdBefore":"","customTimeBefore":"","daysSinceCustomTime":0,"daysSinceNoncurrentTime":0,"isLive":false,"matchesPattern":"","matchesPrefix":[],"matchesStorageClass":[],"matchesSuffix":[],"noncurrentTimeBefore":"","numNewerVersions":0}}]},"location":"","locationType":"","logging":{"logBucket":"","logObjectPrefix":""},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"projectNumber":"","retentionPolicy":{"effectiveTime":"","isLocked":false,"retentionPeriod":""},"rpo":"","satisfiesPZS":false,"selfLink":"","storageClass":"","timeCreated":"","updated":"","versioning":{"enabled":false},"website":{"mainPageSuffix":"","notFoundPage":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "autoclass": {\n "enabled": false,\n "toggleTime": ""\n },\n "billing": {\n "requesterPays": false\n },\n "cors": [\n {\n "maxAgeSeconds": 0,\n "method": [],\n "origin": [],\n "responseHeader": []\n }\n ],\n "customPlacementConfig": {\n "dataLocations": []\n },\n "defaultEventBasedHold": false,\n "defaultObjectAcl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "encryption": {\n "defaultKmsKeyName": ""\n },\n "etag": "",\n "iamConfiguration": {\n "bucketPolicyOnly": {\n "enabled": false,\n "lockedTime": ""\n },\n "publicAccessPrevention": "",\n "uniformBucketLevelAccess": {\n "enabled": false,\n "lockedTime": ""\n }\n },\n "id": "",\n "kind": "",\n "labels": {},\n "lifecycle": {\n "rule": [\n {\n "action": {\n "storageClass": "",\n "type": ""\n },\n "condition": {\n "age": 0,\n "createdBefore": "",\n "customTimeBefore": "",\n "daysSinceCustomTime": 0,\n "daysSinceNoncurrentTime": 0,\n "isLive": false,\n "matchesPattern": "",\n "matchesPrefix": [],\n "matchesStorageClass": [],\n "matchesSuffix": [],\n "noncurrentTimeBefore": "",\n "numNewerVersions": 0\n }\n }\n ]\n },\n "location": "",\n "locationType": "",\n "logging": {\n "logBucket": "",\n "logObjectPrefix": ""\n },\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "projectNumber": "",\n "retentionPolicy": {\n "effectiveTime": "",\n "isLocked": false,\n "retentionPeriod": ""\n },\n "rpo": "",\n "satisfiesPZS": false,\n "selfLink": "",\n "storageClass": "",\n "timeCreated": "",\n "updated": "",\n "versioning": {\n "enabled": false\n },\n "website": {\n "mainPageSuffix": "",\n "notFoundPage": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket',
headers: {'content-type': 'application/json'},
body: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/b/:bucket');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
autoclass: {
enabled: false,
toggleTime: ''
},
billing: {
requesterPays: false
},
cors: [
{
maxAgeSeconds: 0,
method: [],
origin: [],
responseHeader: []
}
],
customPlacementConfig: {
dataLocations: []
},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
encryption: {
defaultKmsKeyName: ''
},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {
enabled: false,
lockedTime: ''
},
publicAccessPrevention: '',
uniformBucketLevelAccess: {
enabled: false,
lockedTime: ''
}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {
storageClass: '',
type: ''
},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {
logBucket: '',
logObjectPrefix: ''
},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
projectNumber: '',
retentionPolicy: {
effectiveTime: '',
isLocked: false,
retentionPeriod: ''
},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {
enabled: false
},
website: {
mainPageSuffix: '',
notFoundPage: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"autoclass":{"enabled":false,"toggleTime":""},"billing":{"requesterPays":false},"cors":[{"maxAgeSeconds":0,"method":[],"origin":[],"responseHeader":[]}],"customPlacementConfig":{"dataLocations":[]},"defaultEventBasedHold":false,"defaultObjectAcl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"encryption":{"defaultKmsKeyName":""},"etag":"","iamConfiguration":{"bucketPolicyOnly":{"enabled":false,"lockedTime":""},"publicAccessPrevention":"","uniformBucketLevelAccess":{"enabled":false,"lockedTime":""}},"id":"","kind":"","labels":{},"lifecycle":{"rule":[{"action":{"storageClass":"","type":""},"condition":{"age":0,"createdBefore":"","customTimeBefore":"","daysSinceCustomTime":0,"daysSinceNoncurrentTime":0,"isLive":false,"matchesPattern":"","matchesPrefix":[],"matchesStorageClass":[],"matchesSuffix":[],"noncurrentTimeBefore":"","numNewerVersions":0}}]},"location":"","locationType":"","logging":{"logBucket":"","logObjectPrefix":""},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"projectNumber":"","retentionPolicy":{"effectiveTime":"","isLocked":false,"retentionPeriod":""},"rpo":"","satisfiesPZS":false,"selfLink":"","storageClass":"","timeCreated":"","updated":"","versioning":{"enabled":false},"website":{"mainPageSuffix":"","notFoundPage":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"acl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"id": @"", @"kind": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ],
@"autoclass": @{ @"enabled": @NO, @"toggleTime": @"" },
@"billing": @{ @"requesterPays": @NO },
@"cors": @[ @{ @"maxAgeSeconds": @0, @"method": @[ ], @"origin": @[ ], @"responseHeader": @[ ] } ],
@"customPlacementConfig": @{ @"dataLocations": @[ ] },
@"defaultEventBasedHold": @NO,
@"defaultObjectAcl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"generation": @"", @"id": @"", @"kind": @"", @"object": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ],
@"encryption": @{ @"defaultKmsKeyName": @"" },
@"etag": @"",
@"iamConfiguration": @{ @"bucketPolicyOnly": @{ @"enabled": @NO, @"lockedTime": @"" }, @"publicAccessPrevention": @"", @"uniformBucketLevelAccess": @{ @"enabled": @NO, @"lockedTime": @"" } },
@"id": @"",
@"kind": @"",
@"labels": @{ },
@"lifecycle": @{ @"rule": @[ @{ @"action": @{ @"storageClass": @"", @"type": @"" }, @"condition": @{ @"age": @0, @"createdBefore": @"", @"customTimeBefore": @"", @"daysSinceCustomTime": @0, @"daysSinceNoncurrentTime": @0, @"isLive": @NO, @"matchesPattern": @"", @"matchesPrefix": @[ ], @"matchesStorageClass": @[ ], @"matchesSuffix": @[ ], @"noncurrentTimeBefore": @"", @"numNewerVersions": @0 } } ] },
@"location": @"",
@"locationType": @"",
@"logging": @{ @"logBucket": @"", @"logObjectPrefix": @"" },
@"metageneration": @"",
@"name": @"",
@"owner": @{ @"entity": @"", @"entityId": @"" },
@"projectNumber": @"",
@"retentionPolicy": @{ @"effectiveTime": @"", @"isLocked": @NO, @"retentionPeriod": @"" },
@"rpo": @"",
@"satisfiesPZS": @NO,
@"selfLink": @"",
@"storageClass": @"",
@"timeCreated": @"",
@"updated": @"",
@"versioning": @{ @"enabled": @NO },
@"website": @{ @"mainPageSuffix": @"", @"notFoundPage": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'autoclass' => [
'enabled' => null,
'toggleTime' => ''
],
'billing' => [
'requesterPays' => null
],
'cors' => [
[
'maxAgeSeconds' => 0,
'method' => [
],
'origin' => [
],
'responseHeader' => [
]
]
],
'customPlacementConfig' => [
'dataLocations' => [
]
],
'defaultEventBasedHold' => null,
'defaultObjectAcl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'encryption' => [
'defaultKmsKeyName' => ''
],
'etag' => '',
'iamConfiguration' => [
'bucketPolicyOnly' => [
'enabled' => null,
'lockedTime' => ''
],
'publicAccessPrevention' => '',
'uniformBucketLevelAccess' => [
'enabled' => null,
'lockedTime' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'lifecycle' => [
'rule' => [
[
'action' => [
'storageClass' => '',
'type' => ''
],
'condition' => [
'age' => 0,
'createdBefore' => '',
'customTimeBefore' => '',
'daysSinceCustomTime' => 0,
'daysSinceNoncurrentTime' => 0,
'isLive' => null,
'matchesPattern' => '',
'matchesPrefix' => [
],
'matchesStorageClass' => [
],
'matchesSuffix' => [
],
'noncurrentTimeBefore' => '',
'numNewerVersions' => 0
]
]
]
],
'location' => '',
'locationType' => '',
'logging' => [
'logBucket' => '',
'logObjectPrefix' => ''
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'projectNumber' => '',
'retentionPolicy' => [
'effectiveTime' => '',
'isLocked' => null,
'retentionPeriod' => ''
],
'rpo' => '',
'satisfiesPZS' => null,
'selfLink' => '',
'storageClass' => '',
'timeCreated' => '',
'updated' => '',
'versioning' => [
'enabled' => null
],
'website' => [
'mainPageSuffix' => '',
'notFoundPage' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/b/:bucket', [
'body' => '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'autoclass' => [
'enabled' => null,
'toggleTime' => ''
],
'billing' => [
'requesterPays' => null
],
'cors' => [
[
'maxAgeSeconds' => 0,
'method' => [
],
'origin' => [
],
'responseHeader' => [
]
]
],
'customPlacementConfig' => [
'dataLocations' => [
]
],
'defaultEventBasedHold' => null,
'defaultObjectAcl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'encryption' => [
'defaultKmsKeyName' => ''
],
'etag' => '',
'iamConfiguration' => [
'bucketPolicyOnly' => [
'enabled' => null,
'lockedTime' => ''
],
'publicAccessPrevention' => '',
'uniformBucketLevelAccess' => [
'enabled' => null,
'lockedTime' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'lifecycle' => [
'rule' => [
[
'action' => [
'storageClass' => '',
'type' => ''
],
'condition' => [
'age' => 0,
'createdBefore' => '',
'customTimeBefore' => '',
'daysSinceCustomTime' => 0,
'daysSinceNoncurrentTime' => 0,
'isLive' => null,
'matchesPattern' => '',
'matchesPrefix' => [
],
'matchesStorageClass' => [
],
'matchesSuffix' => [
],
'noncurrentTimeBefore' => '',
'numNewerVersions' => 0
]
]
]
],
'location' => '',
'locationType' => '',
'logging' => [
'logBucket' => '',
'logObjectPrefix' => ''
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'projectNumber' => '',
'retentionPolicy' => [
'effectiveTime' => '',
'isLocked' => null,
'retentionPeriod' => ''
],
'rpo' => '',
'satisfiesPZS' => null,
'selfLink' => '',
'storageClass' => '',
'timeCreated' => '',
'updated' => '',
'versioning' => [
'enabled' => null
],
'website' => [
'mainPageSuffix' => '',
'notFoundPage' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'autoclass' => [
'enabled' => null,
'toggleTime' => ''
],
'billing' => [
'requesterPays' => null
],
'cors' => [
[
'maxAgeSeconds' => 0,
'method' => [
],
'origin' => [
],
'responseHeader' => [
]
]
],
'customPlacementConfig' => [
'dataLocations' => [
]
],
'defaultEventBasedHold' => null,
'defaultObjectAcl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'encryption' => [
'defaultKmsKeyName' => ''
],
'etag' => '',
'iamConfiguration' => [
'bucketPolicyOnly' => [
'enabled' => null,
'lockedTime' => ''
],
'publicAccessPrevention' => '',
'uniformBucketLevelAccess' => [
'enabled' => null,
'lockedTime' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'lifecycle' => [
'rule' => [
[
'action' => [
'storageClass' => '',
'type' => ''
],
'condition' => [
'age' => 0,
'createdBefore' => '',
'customTimeBefore' => '',
'daysSinceCustomTime' => 0,
'daysSinceNoncurrentTime' => 0,
'isLive' => null,
'matchesPattern' => '',
'matchesPrefix' => [
],
'matchesStorageClass' => [
],
'matchesSuffix' => [
],
'noncurrentTimeBefore' => '',
'numNewerVersions' => 0
]
]
]
],
'location' => '',
'locationType' => '',
'logging' => [
'logBucket' => '',
'logObjectPrefix' => ''
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'projectNumber' => '',
'retentionPolicy' => [
'effectiveTime' => '',
'isLocked' => null,
'retentionPeriod' => ''
],
'rpo' => '',
'satisfiesPZS' => null,
'selfLink' => '',
'storageClass' => '',
'timeCreated' => '',
'updated' => '',
'versioning' => [
'enabled' => null
],
'website' => [
'mainPageSuffix' => '',
'notFoundPage' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/b/:bucket", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket"
payload = {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": False,
"toggleTime": ""
},
"billing": { "requesterPays": False },
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": { "dataLocations": [] },
"defaultEventBasedHold": False,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": { "defaultKmsKeyName": "" },
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": False,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": False,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": { "rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": False,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
] },
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": False,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": False,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": { "enabled": False },
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket"
payload <- "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/b/:bucket') do |req|
req.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket";
let payload = json!({
"acl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"autoclass": json!({
"enabled": false,
"toggleTime": ""
}),
"billing": json!({"requesterPays": false}),
"cors": (
json!({
"maxAgeSeconds": 0,
"method": (),
"origin": (),
"responseHeader": ()
})
),
"customPlacementConfig": json!({"dataLocations": ()}),
"defaultEventBasedHold": false,
"defaultObjectAcl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"encryption": json!({"defaultKmsKeyName": ""}),
"etag": "",
"iamConfiguration": json!({
"bucketPolicyOnly": json!({
"enabled": false,
"lockedTime": ""
}),
"publicAccessPrevention": "",
"uniformBucketLevelAccess": json!({
"enabled": false,
"lockedTime": ""
})
}),
"id": "",
"kind": "",
"labels": json!({}),
"lifecycle": json!({"rule": (
json!({
"action": json!({
"storageClass": "",
"type": ""
}),
"condition": json!({
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": (),
"matchesStorageClass": (),
"matchesSuffix": (),
"noncurrentTimeBefore": "",
"numNewerVersions": 0
})
})
)}),
"location": "",
"locationType": "",
"logging": json!({
"logBucket": "",
"logObjectPrefix": ""
}),
"metageneration": "",
"name": "",
"owner": json!({
"entity": "",
"entityId": ""
}),
"projectNumber": "",
"retentionPolicy": json!({
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
}),
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": json!({"enabled": false}),
"website": json!({
"mainPageSuffix": "",
"notFoundPage": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/b/:bucket \
--header 'content-type: application/json' \
--data '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}'
echo '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}' | \
http PATCH {{baseUrl}}/b/:bucket \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "autoclass": {\n "enabled": false,\n "toggleTime": ""\n },\n "billing": {\n "requesterPays": false\n },\n "cors": [\n {\n "maxAgeSeconds": 0,\n "method": [],\n "origin": [],\n "responseHeader": []\n }\n ],\n "customPlacementConfig": {\n "dataLocations": []\n },\n "defaultEventBasedHold": false,\n "defaultObjectAcl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "encryption": {\n "defaultKmsKeyName": ""\n },\n "etag": "",\n "iamConfiguration": {\n "bucketPolicyOnly": {\n "enabled": false,\n "lockedTime": ""\n },\n "publicAccessPrevention": "",\n "uniformBucketLevelAccess": {\n "enabled": false,\n "lockedTime": ""\n }\n },\n "id": "",\n "kind": "",\n "labels": {},\n "lifecycle": {\n "rule": [\n {\n "action": {\n "storageClass": "",\n "type": ""\n },\n "condition": {\n "age": 0,\n "createdBefore": "",\n "customTimeBefore": "",\n "daysSinceCustomTime": 0,\n "daysSinceNoncurrentTime": 0,\n "isLive": false,\n "matchesPattern": "",\n "matchesPrefix": [],\n "matchesStorageClass": [],\n "matchesSuffix": [],\n "noncurrentTimeBefore": "",\n "numNewerVersions": 0\n }\n }\n ]\n },\n "location": "",\n "locationType": "",\n "logging": {\n "logBucket": "",\n "logObjectPrefix": ""\n },\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "projectNumber": "",\n "retentionPolicy": {\n "effectiveTime": "",\n "isLocked": false,\n "retentionPeriod": ""\n },\n "rpo": "",\n "satisfiesPZS": false,\n "selfLink": "",\n "storageClass": "",\n "timeCreated": "",\n "updated": "",\n "versioning": {\n "enabled": false\n },\n "website": {\n "mainPageSuffix": "",\n "notFoundPage": ""\n }\n}' \
--output-document \
- {{baseUrl}}/b/:bucket
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"acl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"autoclass": [
"enabled": false,
"toggleTime": ""
],
"billing": ["requesterPays": false],
"cors": [
[
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
]
],
"customPlacementConfig": ["dataLocations": []],
"defaultEventBasedHold": false,
"defaultObjectAcl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"encryption": ["defaultKmsKeyName": ""],
"etag": "",
"iamConfiguration": [
"bucketPolicyOnly": [
"enabled": false,
"lockedTime": ""
],
"publicAccessPrevention": "",
"uniformBucketLevelAccess": [
"enabled": false,
"lockedTime": ""
]
],
"id": "",
"kind": "",
"labels": [],
"lifecycle": ["rule": [
[
"action": [
"storageClass": "",
"type": ""
],
"condition": [
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
]
]
]],
"location": "",
"locationType": "",
"logging": [
"logBucket": "",
"logObjectPrefix": ""
],
"metageneration": "",
"name": "",
"owner": [
"entity": "",
"entityId": ""
],
"projectNumber": "",
"retentionPolicy": [
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
],
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": ["enabled": false],
"website": [
"mainPageSuffix": "",
"notFoundPage": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
storage.buckets.setIamPolicy
{{baseUrl}}/b/:bucket/iam
QUERY PARAMS
bucket
BODY json
{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/iam");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/b/:bucket/iam" {:content-type :json
:form-params {:bindings [{:condition {:description ""
:expression ""
:location ""
:title ""}
:members []
:role ""}]
:etag ""
:kind ""
:resourceId ""
:version 0}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/iam"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/iam"),
Content = new StringContent("{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/iam");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/iam"
payload := strings.NewReader("{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/b/:bucket/iam HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 264
{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/b/:bucket/iam")
.setHeader("content-type", "application/json")
.setBody("{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/iam"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/iam")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/b/:bucket/iam")
.header("content-type", "application/json")
.body("{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}")
.asString();
const data = JSON.stringify({
bindings: [
{
condition: {
description: '',
expression: '',
location: '',
title: ''
},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/b/:bucket/iam');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/iam',
headers: {'content-type': 'application/json'},
data: {
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/iam';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bindings":[{"condition":{"description":"","expression":"","location":"","title":""},"members":[],"role":""}],"etag":"","kind":"","resourceId":"","version":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/iam',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bindings": [\n {\n "condition": {\n "description": "",\n "expression": "",\n "location": "",\n "title": ""\n },\n "members": [],\n "role": ""\n }\n ],\n "etag": "",\n "kind": "",\n "resourceId": "",\n "version": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/iam")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/iam',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/iam',
headers: {'content-type': 'application/json'},
body: {
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/b/:bucket/iam');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bindings: [
{
condition: {
description: '',
expression: '',
location: '',
title: ''
},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/iam',
headers: {'content-type': 'application/json'},
data: {
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/iam';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bindings":[{"condition":{"description":"","expression":"","location":"","title":""},"members":[],"role":""}],"etag":"","kind":"","resourceId":"","version":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bindings": @[ @{ @"condition": @{ @"description": @"", @"expression": @"", @"location": @"", @"title": @"" }, @"members": @[ ], @"role": @"" } ],
@"etag": @"",
@"kind": @"",
@"resourceId": @"",
@"version": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/iam"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/iam" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/iam",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'kind' => '',
'resourceId' => '',
'version' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/b/:bucket/iam', [
'body' => '{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/iam');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'kind' => '',
'resourceId' => '',
'version' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'kind' => '',
'resourceId' => '',
'version' => 0
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/iam');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/iam' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/iam' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/b/:bucket/iam", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/iam"
payload = {
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/iam"
payload <- "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/iam")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/b/:bucket/iam') do |req|
req.body = "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/iam";
let payload = json!({
"bindings": (
json!({
"condition": json!({
"description": "",
"expression": "",
"location": "",
"title": ""
}),
"members": (),
"role": ""
})
),
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/b/:bucket/iam \
--header 'content-type: application/json' \
--data '{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}'
echo '{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}' | \
http PUT {{baseUrl}}/b/:bucket/iam \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "bindings": [\n {\n "condition": {\n "description": "",\n "expression": "",\n "location": "",\n "title": ""\n },\n "members": [],\n "role": ""\n }\n ],\n "etag": "",\n "kind": "",\n "resourceId": "",\n "version": 0\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/iam
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bindings": [
[
"condition": [
"description": "",
"expression": "",
"location": "",
"title": ""
],
"members": [],
"role": ""
]
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/iam")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.buckets.testIamPermissions
{{baseUrl}}/b/:bucket/iam/testPermissions
QUERY PARAMS
permissions
bucket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/iam/testPermissions" {:query-params {:permissions ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/iam/testPermissions?permissions="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/iam/testPermissions?permissions="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/iam/testPermissions?permissions="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/iam/testPermissions?permissions= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/iam/testPermissions?permissions="))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/iam/testPermissions',
params: {permissions: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/iam/testPermissions?permissions=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/iam/testPermissions',
qs: {permissions: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/iam/testPermissions');
req.query({
permissions: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/iam/testPermissions',
params: {permissions: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/iam/testPermissions?permissions="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/iam/testPermissions');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'permissions' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/iam/testPermissions');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'permissions' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/iam/testPermissions?permissions=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/iam/testPermissions"
querystring = {"permissions":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/iam/testPermissions"
queryString <- list(permissions = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/iam/testPermissions') do |req|
req.params['permissions'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/iam/testPermissions";
let querystring = [
("permissions", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/b/:bucket/iam/testPermissions?permissions='
http GET '{{baseUrl}}/b/:bucket/iam/testPermissions?permissions='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/b/:bucket/iam/testPermissions?permissions='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/iam/testPermissions?permissions=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
storage.buckets.update
{{baseUrl}}/b/:bucket
QUERY PARAMS
bucket
BODY json
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/b/:bucket" {:content-type :json
:form-params {:acl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:id ""
:kind ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:autoclass {:enabled false
:toggleTime ""}
:billing {:requesterPays false}
:cors [{:maxAgeSeconds 0
:method []
:origin []
:responseHeader []}]
:customPlacementConfig {:dataLocations []}
:defaultEventBasedHold false
:defaultObjectAcl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:encryption {:defaultKmsKeyName ""}
:etag ""
:iamConfiguration {:bucketPolicyOnly {:enabled false
:lockedTime ""}
:publicAccessPrevention ""
:uniformBucketLevelAccess {:enabled false
:lockedTime ""}}
:id ""
:kind ""
:labels {}
:lifecycle {:rule [{:action {:storageClass ""
:type ""}
:condition {:age 0
:createdBefore ""
:customTimeBefore ""
:daysSinceCustomTime 0
:daysSinceNoncurrentTime 0
:isLive false
:matchesPattern ""
:matchesPrefix []
:matchesStorageClass []
:matchesSuffix []
:noncurrentTimeBefore ""
:numNewerVersions 0}}]}
:location ""
:locationType ""
:logging {:logBucket ""
:logObjectPrefix ""}
:metageneration ""
:name ""
:owner {:entity ""
:entityId ""}
:projectNumber ""
:retentionPolicy {:effectiveTime ""
:isLocked false
:retentionPeriod ""}
:rpo ""
:satisfiesPZS false
:selfLink ""
:storageClass ""
:timeCreated ""
:updated ""
:versioning {:enabled false}
:website {:mainPageSuffix ""
:notFoundPage ""}}})
require "http/client"
url = "{{baseUrl}}/b/:bucket"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/b/:bucket"),
Content = new StringContent("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket"
payload := strings.NewReader("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/b/:bucket HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2438
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/b/:bucket")
.setHeader("content-type", "application/json")
.setBody("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/b/:bucket")
.header("content-type", "application/json")
.body("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
autoclass: {
enabled: false,
toggleTime: ''
},
billing: {
requesterPays: false
},
cors: [
{
maxAgeSeconds: 0,
method: [],
origin: [],
responseHeader: []
}
],
customPlacementConfig: {
dataLocations: []
},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
encryption: {
defaultKmsKeyName: ''
},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {
enabled: false,
lockedTime: ''
},
publicAccessPrevention: '',
uniformBucketLevelAccess: {
enabled: false,
lockedTime: ''
}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {
storageClass: '',
type: ''
},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {
logBucket: '',
logObjectPrefix: ''
},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
projectNumber: '',
retentionPolicy: {
effectiveTime: '',
isLocked: false,
retentionPeriod: ''
},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {
enabled: false
},
website: {
mainPageSuffix: '',
notFoundPage: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/b/:bucket');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"autoclass":{"enabled":false,"toggleTime":""},"billing":{"requesterPays":false},"cors":[{"maxAgeSeconds":0,"method":[],"origin":[],"responseHeader":[]}],"customPlacementConfig":{"dataLocations":[]},"defaultEventBasedHold":false,"defaultObjectAcl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"encryption":{"defaultKmsKeyName":""},"etag":"","iamConfiguration":{"bucketPolicyOnly":{"enabled":false,"lockedTime":""},"publicAccessPrevention":"","uniformBucketLevelAccess":{"enabled":false,"lockedTime":""}},"id":"","kind":"","labels":{},"lifecycle":{"rule":[{"action":{"storageClass":"","type":""},"condition":{"age":0,"createdBefore":"","customTimeBefore":"","daysSinceCustomTime":0,"daysSinceNoncurrentTime":0,"isLive":false,"matchesPattern":"","matchesPrefix":[],"matchesStorageClass":[],"matchesSuffix":[],"noncurrentTimeBefore":"","numNewerVersions":0}}]},"location":"","locationType":"","logging":{"logBucket":"","logObjectPrefix":""},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"projectNumber":"","retentionPolicy":{"effectiveTime":"","isLocked":false,"retentionPeriod":""},"rpo":"","satisfiesPZS":false,"selfLink":"","storageClass":"","timeCreated":"","updated":"","versioning":{"enabled":false},"website":{"mainPageSuffix":"","notFoundPage":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "autoclass": {\n "enabled": false,\n "toggleTime": ""\n },\n "billing": {\n "requesterPays": false\n },\n "cors": [\n {\n "maxAgeSeconds": 0,\n "method": [],\n "origin": [],\n "responseHeader": []\n }\n ],\n "customPlacementConfig": {\n "dataLocations": []\n },\n "defaultEventBasedHold": false,\n "defaultObjectAcl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "encryption": {\n "defaultKmsKeyName": ""\n },\n "etag": "",\n "iamConfiguration": {\n "bucketPolicyOnly": {\n "enabled": false,\n "lockedTime": ""\n },\n "publicAccessPrevention": "",\n "uniformBucketLevelAccess": {\n "enabled": false,\n "lockedTime": ""\n }\n },\n "id": "",\n "kind": "",\n "labels": {},\n "lifecycle": {\n "rule": [\n {\n "action": {\n "storageClass": "",\n "type": ""\n },\n "condition": {\n "age": 0,\n "createdBefore": "",\n "customTimeBefore": "",\n "daysSinceCustomTime": 0,\n "daysSinceNoncurrentTime": 0,\n "isLive": false,\n "matchesPattern": "",\n "matchesPrefix": [],\n "matchesStorageClass": [],\n "matchesSuffix": [],\n "noncurrentTimeBefore": "",\n "numNewerVersions": 0\n }\n }\n ]\n },\n "location": "",\n "locationType": "",\n "logging": {\n "logBucket": "",\n "logObjectPrefix": ""\n },\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "projectNumber": "",\n "retentionPolicy": {\n "effectiveTime": "",\n "isLocked": false,\n "retentionPeriod": ""\n },\n "rpo": "",\n "satisfiesPZS": false,\n "selfLink": "",\n "storageClass": "",\n "timeCreated": "",\n "updated": "",\n "versioning": {\n "enabled": false\n },\n "website": {\n "mainPageSuffix": "",\n "notFoundPage": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket',
headers: {'content-type': 'application/json'},
body: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/b/:bucket');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
autoclass: {
enabled: false,
toggleTime: ''
},
billing: {
requesterPays: false
},
cors: [
{
maxAgeSeconds: 0,
method: [],
origin: [],
responseHeader: []
}
],
customPlacementConfig: {
dataLocations: []
},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
encryption: {
defaultKmsKeyName: ''
},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {
enabled: false,
lockedTime: ''
},
publicAccessPrevention: '',
uniformBucketLevelAccess: {
enabled: false,
lockedTime: ''
}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {
storageClass: '',
type: ''
},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {
logBucket: '',
logObjectPrefix: ''
},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
projectNumber: '',
retentionPolicy: {
effectiveTime: '',
isLocked: false,
retentionPeriod: ''
},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {
enabled: false
},
website: {
mainPageSuffix: '',
notFoundPage: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
id: '',
kind: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
autoclass: {enabled: false, toggleTime: ''},
billing: {requesterPays: false},
cors: [{maxAgeSeconds: 0, method: [], origin: [], responseHeader: []}],
customPlacementConfig: {dataLocations: []},
defaultEventBasedHold: false,
defaultObjectAcl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
encryption: {defaultKmsKeyName: ''},
etag: '',
iamConfiguration: {
bucketPolicyOnly: {enabled: false, lockedTime: ''},
publicAccessPrevention: '',
uniformBucketLevelAccess: {enabled: false, lockedTime: ''}
},
id: '',
kind: '',
labels: {},
lifecycle: {
rule: [
{
action: {storageClass: '', type: ''},
condition: {
age: 0,
createdBefore: '',
customTimeBefore: '',
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
isLive: false,
matchesPattern: '',
matchesPrefix: [],
matchesStorageClass: [],
matchesSuffix: [],
noncurrentTimeBefore: '',
numNewerVersions: 0
}
}
]
},
location: '',
locationType: '',
logging: {logBucket: '', logObjectPrefix: ''},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
projectNumber: '',
retentionPolicy: {effectiveTime: '', isLocked: false, retentionPeriod: ''},
rpo: '',
satisfiesPZS: false,
selfLink: '',
storageClass: '',
timeCreated: '',
updated: '',
versioning: {enabled: false},
website: {mainPageSuffix: '', notFoundPage: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","id":"","kind":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"autoclass":{"enabled":false,"toggleTime":""},"billing":{"requesterPays":false},"cors":[{"maxAgeSeconds":0,"method":[],"origin":[],"responseHeader":[]}],"customPlacementConfig":{"dataLocations":[]},"defaultEventBasedHold":false,"defaultObjectAcl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"encryption":{"defaultKmsKeyName":""},"etag":"","iamConfiguration":{"bucketPolicyOnly":{"enabled":false,"lockedTime":""},"publicAccessPrevention":"","uniformBucketLevelAccess":{"enabled":false,"lockedTime":""}},"id":"","kind":"","labels":{},"lifecycle":{"rule":[{"action":{"storageClass":"","type":""},"condition":{"age":0,"createdBefore":"","customTimeBefore":"","daysSinceCustomTime":0,"daysSinceNoncurrentTime":0,"isLive":false,"matchesPattern":"","matchesPrefix":[],"matchesStorageClass":[],"matchesSuffix":[],"noncurrentTimeBefore":"","numNewerVersions":0}}]},"location":"","locationType":"","logging":{"logBucket":"","logObjectPrefix":""},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"projectNumber":"","retentionPolicy":{"effectiveTime":"","isLocked":false,"retentionPeriod":""},"rpo":"","satisfiesPZS":false,"selfLink":"","storageClass":"","timeCreated":"","updated":"","versioning":{"enabled":false},"website":{"mainPageSuffix":"","notFoundPage":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"acl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"id": @"", @"kind": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ],
@"autoclass": @{ @"enabled": @NO, @"toggleTime": @"" },
@"billing": @{ @"requesterPays": @NO },
@"cors": @[ @{ @"maxAgeSeconds": @0, @"method": @[ ], @"origin": @[ ], @"responseHeader": @[ ] } ],
@"customPlacementConfig": @{ @"dataLocations": @[ ] },
@"defaultEventBasedHold": @NO,
@"defaultObjectAcl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"generation": @"", @"id": @"", @"kind": @"", @"object": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ],
@"encryption": @{ @"defaultKmsKeyName": @"" },
@"etag": @"",
@"iamConfiguration": @{ @"bucketPolicyOnly": @{ @"enabled": @NO, @"lockedTime": @"" }, @"publicAccessPrevention": @"", @"uniformBucketLevelAccess": @{ @"enabled": @NO, @"lockedTime": @"" } },
@"id": @"",
@"kind": @"",
@"labels": @{ },
@"lifecycle": @{ @"rule": @[ @{ @"action": @{ @"storageClass": @"", @"type": @"" }, @"condition": @{ @"age": @0, @"createdBefore": @"", @"customTimeBefore": @"", @"daysSinceCustomTime": @0, @"daysSinceNoncurrentTime": @0, @"isLive": @NO, @"matchesPattern": @"", @"matchesPrefix": @[ ], @"matchesStorageClass": @[ ], @"matchesSuffix": @[ ], @"noncurrentTimeBefore": @"", @"numNewerVersions": @0 } } ] },
@"location": @"",
@"locationType": @"",
@"logging": @{ @"logBucket": @"", @"logObjectPrefix": @"" },
@"metageneration": @"",
@"name": @"",
@"owner": @{ @"entity": @"", @"entityId": @"" },
@"projectNumber": @"",
@"retentionPolicy": @{ @"effectiveTime": @"", @"isLocked": @NO, @"retentionPeriod": @"" },
@"rpo": @"",
@"satisfiesPZS": @NO,
@"selfLink": @"",
@"storageClass": @"",
@"timeCreated": @"",
@"updated": @"",
@"versioning": @{ @"enabled": @NO },
@"website": @{ @"mainPageSuffix": @"", @"notFoundPage": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'autoclass' => [
'enabled' => null,
'toggleTime' => ''
],
'billing' => [
'requesterPays' => null
],
'cors' => [
[
'maxAgeSeconds' => 0,
'method' => [
],
'origin' => [
],
'responseHeader' => [
]
]
],
'customPlacementConfig' => [
'dataLocations' => [
]
],
'defaultEventBasedHold' => null,
'defaultObjectAcl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'encryption' => [
'defaultKmsKeyName' => ''
],
'etag' => '',
'iamConfiguration' => [
'bucketPolicyOnly' => [
'enabled' => null,
'lockedTime' => ''
],
'publicAccessPrevention' => '',
'uniformBucketLevelAccess' => [
'enabled' => null,
'lockedTime' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'lifecycle' => [
'rule' => [
[
'action' => [
'storageClass' => '',
'type' => ''
],
'condition' => [
'age' => 0,
'createdBefore' => '',
'customTimeBefore' => '',
'daysSinceCustomTime' => 0,
'daysSinceNoncurrentTime' => 0,
'isLive' => null,
'matchesPattern' => '',
'matchesPrefix' => [
],
'matchesStorageClass' => [
],
'matchesSuffix' => [
],
'noncurrentTimeBefore' => '',
'numNewerVersions' => 0
]
]
]
],
'location' => '',
'locationType' => '',
'logging' => [
'logBucket' => '',
'logObjectPrefix' => ''
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'projectNumber' => '',
'retentionPolicy' => [
'effectiveTime' => '',
'isLocked' => null,
'retentionPeriod' => ''
],
'rpo' => '',
'satisfiesPZS' => null,
'selfLink' => '',
'storageClass' => '',
'timeCreated' => '',
'updated' => '',
'versioning' => [
'enabled' => null
],
'website' => [
'mainPageSuffix' => '',
'notFoundPage' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/b/:bucket', [
'body' => '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'autoclass' => [
'enabled' => null,
'toggleTime' => ''
],
'billing' => [
'requesterPays' => null
],
'cors' => [
[
'maxAgeSeconds' => 0,
'method' => [
],
'origin' => [
],
'responseHeader' => [
]
]
],
'customPlacementConfig' => [
'dataLocations' => [
]
],
'defaultEventBasedHold' => null,
'defaultObjectAcl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'encryption' => [
'defaultKmsKeyName' => ''
],
'etag' => '',
'iamConfiguration' => [
'bucketPolicyOnly' => [
'enabled' => null,
'lockedTime' => ''
],
'publicAccessPrevention' => '',
'uniformBucketLevelAccess' => [
'enabled' => null,
'lockedTime' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'lifecycle' => [
'rule' => [
[
'action' => [
'storageClass' => '',
'type' => ''
],
'condition' => [
'age' => 0,
'createdBefore' => '',
'customTimeBefore' => '',
'daysSinceCustomTime' => 0,
'daysSinceNoncurrentTime' => 0,
'isLive' => null,
'matchesPattern' => '',
'matchesPrefix' => [
],
'matchesStorageClass' => [
],
'matchesSuffix' => [
],
'noncurrentTimeBefore' => '',
'numNewerVersions' => 0
]
]
]
],
'location' => '',
'locationType' => '',
'logging' => [
'logBucket' => '',
'logObjectPrefix' => ''
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'projectNumber' => '',
'retentionPolicy' => [
'effectiveTime' => '',
'isLocked' => null,
'retentionPeriod' => ''
],
'rpo' => '',
'satisfiesPZS' => null,
'selfLink' => '',
'storageClass' => '',
'timeCreated' => '',
'updated' => '',
'versioning' => [
'enabled' => null
],
'website' => [
'mainPageSuffix' => '',
'notFoundPage' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'autoclass' => [
'enabled' => null,
'toggleTime' => ''
],
'billing' => [
'requesterPays' => null
],
'cors' => [
[
'maxAgeSeconds' => 0,
'method' => [
],
'origin' => [
],
'responseHeader' => [
]
]
],
'customPlacementConfig' => [
'dataLocations' => [
]
],
'defaultEventBasedHold' => null,
'defaultObjectAcl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'encryption' => [
'defaultKmsKeyName' => ''
],
'etag' => '',
'iamConfiguration' => [
'bucketPolicyOnly' => [
'enabled' => null,
'lockedTime' => ''
],
'publicAccessPrevention' => '',
'uniformBucketLevelAccess' => [
'enabled' => null,
'lockedTime' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'lifecycle' => [
'rule' => [
[
'action' => [
'storageClass' => '',
'type' => ''
],
'condition' => [
'age' => 0,
'createdBefore' => '',
'customTimeBefore' => '',
'daysSinceCustomTime' => 0,
'daysSinceNoncurrentTime' => 0,
'isLive' => null,
'matchesPattern' => '',
'matchesPrefix' => [
],
'matchesStorageClass' => [
],
'matchesSuffix' => [
],
'noncurrentTimeBefore' => '',
'numNewerVersions' => 0
]
]
]
],
'location' => '',
'locationType' => '',
'logging' => [
'logBucket' => '',
'logObjectPrefix' => ''
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'projectNumber' => '',
'retentionPolicy' => [
'effectiveTime' => '',
'isLocked' => null,
'retentionPeriod' => ''
],
'rpo' => '',
'satisfiesPZS' => null,
'selfLink' => '',
'storageClass' => '',
'timeCreated' => '',
'updated' => '',
'versioning' => [
'enabled' => null
],
'website' => [
'mainPageSuffix' => '',
'notFoundPage' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/b/:bucket", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket"
payload = {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": False,
"toggleTime": ""
},
"billing": { "requesterPays": False },
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": { "dataLocations": [] },
"defaultEventBasedHold": False,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": { "defaultKmsKeyName": "" },
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": False,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": False,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": { "rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": False,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
] },
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": False,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": False,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": { "enabled": False },
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket"
payload <- "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/b/:bucket') do |req|
req.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"autoclass\": {\n \"enabled\": false,\n \"toggleTime\": \"\"\n },\n \"billing\": {\n \"requesterPays\": false\n },\n \"cors\": [\n {\n \"maxAgeSeconds\": 0,\n \"method\": [],\n \"origin\": [],\n \"responseHeader\": []\n }\n ],\n \"customPlacementConfig\": {\n \"dataLocations\": []\n },\n \"defaultEventBasedHold\": false,\n \"defaultObjectAcl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"encryption\": {\n \"defaultKmsKeyName\": \"\"\n },\n \"etag\": \"\",\n \"iamConfiguration\": {\n \"bucketPolicyOnly\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n },\n \"publicAccessPrevention\": \"\",\n \"uniformBucketLevelAccess\": {\n \"enabled\": false,\n \"lockedTime\": \"\"\n }\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"lifecycle\": {\n \"rule\": [\n {\n \"action\": {\n \"storageClass\": \"\",\n \"type\": \"\"\n },\n \"condition\": {\n \"age\": 0,\n \"createdBefore\": \"\",\n \"customTimeBefore\": \"\",\n \"daysSinceCustomTime\": 0,\n \"daysSinceNoncurrentTime\": 0,\n \"isLive\": false,\n \"matchesPattern\": \"\",\n \"matchesPrefix\": [],\n \"matchesStorageClass\": [],\n \"matchesSuffix\": [],\n \"noncurrentTimeBefore\": \"\",\n \"numNewerVersions\": 0\n }\n }\n ]\n },\n \"location\": \"\",\n \"locationType\": \"\",\n \"logging\": {\n \"logBucket\": \"\",\n \"logObjectPrefix\": \"\"\n },\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"projectNumber\": \"\",\n \"retentionPolicy\": {\n \"effectiveTime\": \"\",\n \"isLocked\": false,\n \"retentionPeriod\": \"\"\n },\n \"rpo\": \"\",\n \"satisfiesPZS\": false,\n \"selfLink\": \"\",\n \"storageClass\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\",\n \"versioning\": {\n \"enabled\": false\n },\n \"website\": {\n \"mainPageSuffix\": \"\",\n \"notFoundPage\": \"\"\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket";
let payload = json!({
"acl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"autoclass": json!({
"enabled": false,
"toggleTime": ""
}),
"billing": json!({"requesterPays": false}),
"cors": (
json!({
"maxAgeSeconds": 0,
"method": (),
"origin": (),
"responseHeader": ()
})
),
"customPlacementConfig": json!({"dataLocations": ()}),
"defaultEventBasedHold": false,
"defaultObjectAcl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"encryption": json!({"defaultKmsKeyName": ""}),
"etag": "",
"iamConfiguration": json!({
"bucketPolicyOnly": json!({
"enabled": false,
"lockedTime": ""
}),
"publicAccessPrevention": "",
"uniformBucketLevelAccess": json!({
"enabled": false,
"lockedTime": ""
})
}),
"id": "",
"kind": "",
"labels": json!({}),
"lifecycle": json!({"rule": (
json!({
"action": json!({
"storageClass": "",
"type": ""
}),
"condition": json!({
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": (),
"matchesStorageClass": (),
"matchesSuffix": (),
"noncurrentTimeBefore": "",
"numNewerVersions": 0
})
})
)}),
"location": "",
"locationType": "",
"logging": json!({
"logBucket": "",
"logObjectPrefix": ""
}),
"metageneration": "",
"name": "",
"owner": json!({
"entity": "",
"entityId": ""
}),
"projectNumber": "",
"retentionPolicy": json!({
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
}),
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": json!({"enabled": false}),
"website": json!({
"mainPageSuffix": "",
"notFoundPage": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/b/:bucket \
--header 'content-type: application/json' \
--data '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}'
echo '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"autoclass": {
"enabled": false,
"toggleTime": ""
},
"billing": {
"requesterPays": false
},
"cors": [
{
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
}
],
"customPlacementConfig": {
"dataLocations": []
},
"defaultEventBasedHold": false,
"defaultObjectAcl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"encryption": {
"defaultKmsKeyName": ""
},
"etag": "",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false,
"lockedTime": ""
},
"publicAccessPrevention": "",
"uniformBucketLevelAccess": {
"enabled": false,
"lockedTime": ""
}
},
"id": "",
"kind": "",
"labels": {},
"lifecycle": {
"rule": [
{
"action": {
"storageClass": "",
"type": ""
},
"condition": {
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
}
}
]
},
"location": "",
"locationType": "",
"logging": {
"logBucket": "",
"logObjectPrefix": ""
},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"projectNumber": "",
"retentionPolicy": {
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
},
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": {
"enabled": false
},
"website": {
"mainPageSuffix": "",
"notFoundPage": ""
}
}' | \
http PUT {{baseUrl}}/b/:bucket \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "autoclass": {\n "enabled": false,\n "toggleTime": ""\n },\n "billing": {\n "requesterPays": false\n },\n "cors": [\n {\n "maxAgeSeconds": 0,\n "method": [],\n "origin": [],\n "responseHeader": []\n }\n ],\n "customPlacementConfig": {\n "dataLocations": []\n },\n "defaultEventBasedHold": false,\n "defaultObjectAcl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "encryption": {\n "defaultKmsKeyName": ""\n },\n "etag": "",\n "iamConfiguration": {\n "bucketPolicyOnly": {\n "enabled": false,\n "lockedTime": ""\n },\n "publicAccessPrevention": "",\n "uniformBucketLevelAccess": {\n "enabled": false,\n "lockedTime": ""\n }\n },\n "id": "",\n "kind": "",\n "labels": {},\n "lifecycle": {\n "rule": [\n {\n "action": {\n "storageClass": "",\n "type": ""\n },\n "condition": {\n "age": 0,\n "createdBefore": "",\n "customTimeBefore": "",\n "daysSinceCustomTime": 0,\n "daysSinceNoncurrentTime": 0,\n "isLive": false,\n "matchesPattern": "",\n "matchesPrefix": [],\n "matchesStorageClass": [],\n "matchesSuffix": [],\n "noncurrentTimeBefore": "",\n "numNewerVersions": 0\n }\n }\n ]\n },\n "location": "",\n "locationType": "",\n "logging": {\n "logBucket": "",\n "logObjectPrefix": ""\n },\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "projectNumber": "",\n "retentionPolicy": {\n "effectiveTime": "",\n "isLocked": false,\n "retentionPeriod": ""\n },\n "rpo": "",\n "satisfiesPZS": false,\n "selfLink": "",\n "storageClass": "",\n "timeCreated": "",\n "updated": "",\n "versioning": {\n "enabled": false\n },\n "website": {\n "mainPageSuffix": "",\n "notFoundPage": ""\n }\n}' \
--output-document \
- {{baseUrl}}/b/:bucket
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"acl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"id": "",
"kind": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"autoclass": [
"enabled": false,
"toggleTime": ""
],
"billing": ["requesterPays": false],
"cors": [
[
"maxAgeSeconds": 0,
"method": [],
"origin": [],
"responseHeader": []
]
],
"customPlacementConfig": ["dataLocations": []],
"defaultEventBasedHold": false,
"defaultObjectAcl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"encryption": ["defaultKmsKeyName": ""],
"etag": "",
"iamConfiguration": [
"bucketPolicyOnly": [
"enabled": false,
"lockedTime": ""
],
"publicAccessPrevention": "",
"uniformBucketLevelAccess": [
"enabled": false,
"lockedTime": ""
]
],
"id": "",
"kind": "",
"labels": [],
"lifecycle": ["rule": [
[
"action": [
"storageClass": "",
"type": ""
],
"condition": [
"age": 0,
"createdBefore": "",
"customTimeBefore": "",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"isLive": false,
"matchesPattern": "",
"matchesPrefix": [],
"matchesStorageClass": [],
"matchesSuffix": [],
"noncurrentTimeBefore": "",
"numNewerVersions": 0
]
]
]],
"location": "",
"locationType": "",
"logging": [
"logBucket": "",
"logObjectPrefix": ""
],
"metageneration": "",
"name": "",
"owner": [
"entity": "",
"entityId": ""
],
"projectNumber": "",
"retentionPolicy": [
"effectiveTime": "",
"isLocked": false,
"retentionPeriod": ""
],
"rpo": "",
"satisfiesPZS": false,
"selfLink": "",
"storageClass": "",
"timeCreated": "",
"updated": "",
"versioning": ["enabled": false],
"website": [
"mainPageSuffix": "",
"notFoundPage": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.channels.stop
{{baseUrl}}/channels/stop
BODY json
{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/channels/stop");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/channels/stop" {:content-type :json
:form-params {:address ""
:expiration ""
:id ""
:kind ""
:params {}
:payload false
:resourceId ""
:resourceUri ""
:token ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/channels/stop"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/channels/stop"),
Content = new StringContent("{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/channels/stop");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/channels/stop"
payload := strings.NewReader("{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/channels/stop HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 171
{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/channels/stop")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/channels/stop"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/channels/stop")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/channels/stop")
.header("content-type", "application/json")
.body("{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/channels/stop');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/channels/stop',
headers: {'content-type': 'application/json'},
data: {
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/channels/stop';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"address":"","expiration":"","id":"","kind":"","params":{},"payload":false,"resourceId":"","resourceUri":"","token":"","type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/channels/stop',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": "",\n "expiration": "",\n "id": "",\n "kind": "",\n "params": {},\n "payload": false,\n "resourceId": "",\n "resourceUri": "",\n "token": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/channels/stop")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/channels/stop',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/channels/stop',
headers: {'content-type': 'application/json'},
body: {
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/channels/stop');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/channels/stop',
headers: {'content-type': 'application/json'},
data: {
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/channels/stop';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"address":"","expiration":"","id":"","kind":"","params":{},"payload":false,"resourceId":"","resourceUri":"","token":"","type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"address": @"",
@"expiration": @"",
@"id": @"",
@"kind": @"",
@"params": @{ },
@"payload": @NO,
@"resourceId": @"",
@"resourceUri": @"",
@"token": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/channels/stop"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/channels/stop" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/channels/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => '',
'expiration' => '',
'id' => '',
'kind' => '',
'params' => [
],
'payload' => null,
'resourceId' => '',
'resourceUri' => '',
'token' => '',
'type' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/channels/stop', [
'body' => '{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/channels/stop');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => '',
'expiration' => '',
'id' => '',
'kind' => '',
'params' => [
],
'payload' => null,
'resourceId' => '',
'resourceUri' => '',
'token' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => '',
'expiration' => '',
'id' => '',
'kind' => '',
'params' => [
],
'payload' => null,
'resourceId' => '',
'resourceUri' => '',
'token' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/channels/stop');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/channels/stop' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/channels/stop' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/channels/stop", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/channels/stop"
payload = {
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": False,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/channels/stop"
payload <- "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/channels/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/channels/stop') do |req|
req.body = "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/channels/stop";
let payload = json!({
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": json!({}),
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/channels/stop \
--header 'content-type: application/json' \
--data '{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}'
echo '{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}' | \
http POST {{baseUrl}}/channels/stop \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "address": "",\n "expiration": "",\n "id": "",\n "kind": "",\n "params": {},\n "payload": false,\n "resourceId": "",\n "resourceUri": "",\n "token": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/channels/stop
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": [],
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/channels/stop")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
storage.defaultObjectAccessControls.delete
{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
QUERY PARAMS
bucket
entity
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
require "http/client"
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/b/:bucket/defaultObjectAcl/:entity HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/defaultObjectAcl/:entity',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/b/:bucket/defaultObjectAcl/:entity")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/b/:bucket/defaultObjectAcl/:entity') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
http DELETE {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.defaultObjectAccessControls.get
{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
QUERY PARAMS
bucket
entity
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
require "http/client"
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/defaultObjectAcl/:entity HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/defaultObjectAcl/:entity',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/defaultObjectAcl/:entity")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/defaultObjectAcl/:entity') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
http GET {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.defaultObjectAccessControls.insert
{{baseUrl}}/b/:bucket/defaultObjectAcl
QUERY PARAMS
bucket
BODY json
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/defaultObjectAcl");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b/:bucket/defaultObjectAcl" {:content-type :json
:form-params {:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/defaultObjectAcl"),
Content = new StringContent("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/defaultObjectAcl");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/defaultObjectAcl"
payload := strings.NewReader("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b/:bucket/defaultObjectAcl HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 255
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b/:bucket/defaultObjectAcl")
.setHeader("content-type", "application/json")
.setBody("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/defaultObjectAcl"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b/:bucket/defaultObjectAcl")
.header("content-type", "application/json")
.body("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.asString();
const data = JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b/:bucket/defaultObjectAcl');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/defaultObjectAcl',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl',
headers: {'content-type': 'application/json'},
body: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b/:bucket/defaultObjectAcl');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bucket": @"",
@"domain": @"",
@"email": @"",
@"entity": @"",
@"entityId": @"",
@"etag": @"",
@"generation": @"",
@"id": @"",
@"kind": @"",
@"object": @"",
@"projectTeam": @{ @"projectNumber": @"", @"team": @"" },
@"role": @"",
@"selfLink": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/defaultObjectAcl"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/defaultObjectAcl" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/defaultObjectAcl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b/:bucket/defaultObjectAcl', [
'body' => '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/b/:bucket/defaultObjectAcl", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl"
payload = {
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/defaultObjectAcl"
payload <- "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/defaultObjectAcl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/b/:bucket/defaultObjectAcl') do |req|
req.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/defaultObjectAcl";
let payload = json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/b/:bucket/defaultObjectAcl \
--header 'content-type: application/json' \
--data '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
echo '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}' | \
http POST {{baseUrl}}/b/:bucket/defaultObjectAcl \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/defaultObjectAcl
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/defaultObjectAcl")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.defaultObjectAccessControls.list
{{baseUrl}}/b/:bucket/defaultObjectAcl
QUERY PARAMS
bucket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/defaultObjectAcl");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/defaultObjectAcl")
require "http/client"
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/defaultObjectAcl"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/defaultObjectAcl");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/defaultObjectAcl"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/defaultObjectAcl HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/defaultObjectAcl")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/defaultObjectAcl"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/defaultObjectAcl")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/defaultObjectAcl');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/defaultObjectAcl'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/defaultObjectAcl',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/defaultObjectAcl'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/defaultObjectAcl');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/defaultObjectAcl'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/defaultObjectAcl"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/defaultObjectAcl" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/defaultObjectAcl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/defaultObjectAcl');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/defaultObjectAcl")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/defaultObjectAcl"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/defaultObjectAcl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/defaultObjectAcl') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/defaultObjectAcl";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/defaultObjectAcl
http GET {{baseUrl}}/b/:bucket/defaultObjectAcl
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/defaultObjectAcl
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/defaultObjectAcl")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PATCH
storage.defaultObjectAccessControls.patch
{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
QUERY PARAMS
bucket
entity
BODY json
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity" {:content-type :json
:form-params {:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"),
Content = new StringContent("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
payload := strings.NewReader("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/b/:bucket/defaultObjectAcl/:entity HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 255
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.setHeader("content-type", "application/json")
.setBody("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.header("content-type", "application/json")
.body("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.asString();
const data = JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/defaultObjectAcl/:entity',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity',
headers: {'content-type': 'application/json'},
body: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bucket": @"",
@"domain": @"",
@"email": @"",
@"entity": @"",
@"entityId": @"",
@"etag": @"",
@"generation": @"",
@"id": @"",
@"kind": @"",
@"object": @"",
@"projectTeam": @{ @"projectNumber": @"", @"team": @"" },
@"role": @"",
@"selfLink": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity', [
'body' => '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/b/:bucket/defaultObjectAcl/:entity", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
payload = {
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
payload <- "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/b/:bucket/defaultObjectAcl/:entity') do |req|
req.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity";
let payload = json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity \
--header 'content-type: application/json' \
--data '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
echo '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}' | \
http PATCH {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
storage.defaultObjectAccessControls.update
{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
QUERY PARAMS
bucket
entity
BODY json
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity" {:content-type :json
:form-params {:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"),
Content = new StringContent("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
payload := strings.NewReader("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/b/:bucket/defaultObjectAcl/:entity HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 255
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.setHeader("content-type", "application/json")
.setBody("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.header("content-type", "application/json")
.body("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.asString();
const data = JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/defaultObjectAcl/:entity',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity',
headers: {'content-type': 'application/json'},
body: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bucket": @"",
@"domain": @"",
@"email": @"",
@"entity": @"",
@"entityId": @"",
@"etag": @"",
@"generation": @"",
@"id": @"",
@"kind": @"",
@"object": @"",
@"projectTeam": @{ @"projectNumber": @"", @"team": @"" },
@"role": @"",
@"selfLink": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity', [
'body' => '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/b/:bucket/defaultObjectAcl/:entity", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
payload = {
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity"
payload <- "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/b/:bucket/defaultObjectAcl/:entity') do |req|
req.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity";
let payload = json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity \
--header 'content-type: application/json' \
--data '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
echo '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}' | \
http PUT {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/defaultObjectAcl/:entity
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/defaultObjectAcl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
storage.notifications.delete
{{baseUrl}}/b/:bucket/notificationConfigs/:notification
QUERY PARAMS
bucket
notification
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/notificationConfigs/:notification");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
require "http/client"
url = "{{baseUrl}}/b/:bucket/notificationConfigs/:notification"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/notificationConfigs/:notification"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/notificationConfigs/:notification");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/notificationConfigs/:notification"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/b/:bucket/notificationConfigs/:notification HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/notificationConfigs/:notification"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/b/:bucket/notificationConfigs/:notification');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/b/:bucket/notificationConfigs/:notification'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/notificationConfigs/:notification';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/notificationConfigs/:notification',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/notificationConfigs/:notification',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/b/:bucket/notificationConfigs/:notification'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/b/:bucket/notificationConfigs/:notification');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/b/:bucket/notificationConfigs/:notification'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/notificationConfigs/:notification';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/notificationConfigs/:notification"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/notificationConfigs/:notification" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/notificationConfigs/:notification",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/b/:bucket/notificationConfigs/:notification');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/notificationConfigs/:notification');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/notificationConfigs/:notification');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/notificationConfigs/:notification' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/notificationConfigs/:notification' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/b/:bucket/notificationConfigs/:notification")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/notificationConfigs/:notification"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/notificationConfigs/:notification"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/b/:bucket/notificationConfigs/:notification') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/notificationConfigs/:notification";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/b/:bucket/notificationConfigs/:notification
http DELETE {{baseUrl}}/b/:bucket/notificationConfigs/:notification
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/b/:bucket/notificationConfigs/:notification
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/notificationConfigs/:notification")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.notifications.get
{{baseUrl}}/b/:bucket/notificationConfigs/:notification
QUERY PARAMS
bucket
notification
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/notificationConfigs/:notification");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
require "http/client"
url = "{{baseUrl}}/b/:bucket/notificationConfigs/:notification"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/notificationConfigs/:notification"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/notificationConfigs/:notification");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/notificationConfigs/:notification"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/notificationConfigs/:notification HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/notificationConfigs/:notification"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/notificationConfigs/:notification');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/notificationConfigs/:notification'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/notificationConfigs/:notification';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/notificationConfigs/:notification',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/notificationConfigs/:notification',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/notificationConfigs/:notification'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/notificationConfigs/:notification');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/notificationConfigs/:notification'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/notificationConfigs/:notification';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/notificationConfigs/:notification"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/notificationConfigs/:notification" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/notificationConfigs/:notification",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/notificationConfigs/:notification');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/notificationConfigs/:notification');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/notificationConfigs/:notification');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/notificationConfigs/:notification' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/notificationConfigs/:notification' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/notificationConfigs/:notification")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/notificationConfigs/:notification"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/notificationConfigs/:notification"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/notificationConfigs/:notification")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/notificationConfigs/:notification') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/notificationConfigs/:notification";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/notificationConfigs/:notification
http GET {{baseUrl}}/b/:bucket/notificationConfigs/:notification
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/notificationConfigs/:notification
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/notificationConfigs/:notification")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.notifications.insert
{{baseUrl}}/b/:bucket/notificationConfigs
QUERY PARAMS
bucket
BODY json
{
"custom_attributes": {},
"etag": "",
"event_types": [],
"id": "",
"kind": "",
"object_name_prefix": "",
"payload_format": "",
"selfLink": "",
"topic": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/notificationConfigs");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b/:bucket/notificationConfigs" {:content-type :json
:form-params {:custom_attributes {}
:etag ""
:event_types []
:id ""
:kind ""
:object_name_prefix ""
:payload_format ""
:selfLink ""
:topic ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/notificationConfigs"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/notificationConfigs"),
Content = new StringContent("{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/notificationConfigs");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/notificationConfigs"
payload := strings.NewReader("{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b/:bucket/notificationConfigs HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 175
{
"custom_attributes": {},
"etag": "",
"event_types": [],
"id": "",
"kind": "",
"object_name_prefix": "",
"payload_format": "",
"selfLink": "",
"topic": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b/:bucket/notificationConfigs")
.setHeader("content-type", "application/json")
.setBody("{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/notificationConfigs"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/notificationConfigs")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b/:bucket/notificationConfigs")
.header("content-type", "application/json")
.body("{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}")
.asString();
const data = JSON.stringify({
custom_attributes: {},
etag: '',
event_types: [],
id: '',
kind: '',
object_name_prefix: '',
payload_format: '',
selfLink: '',
topic: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b/:bucket/notificationConfigs');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/notificationConfigs',
headers: {'content-type': 'application/json'},
data: {
custom_attributes: {},
etag: '',
event_types: [],
id: '',
kind: '',
object_name_prefix: '',
payload_format: '',
selfLink: '',
topic: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/notificationConfigs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"custom_attributes":{},"etag":"","event_types":[],"id":"","kind":"","object_name_prefix":"","payload_format":"","selfLink":"","topic":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/notificationConfigs',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "custom_attributes": {},\n "etag": "",\n "event_types": [],\n "id": "",\n "kind": "",\n "object_name_prefix": "",\n "payload_format": "",\n "selfLink": "",\n "topic": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/notificationConfigs")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/notificationConfigs',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
custom_attributes: {},
etag: '',
event_types: [],
id: '',
kind: '',
object_name_prefix: '',
payload_format: '',
selfLink: '',
topic: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/notificationConfigs',
headers: {'content-type': 'application/json'},
body: {
custom_attributes: {},
etag: '',
event_types: [],
id: '',
kind: '',
object_name_prefix: '',
payload_format: '',
selfLink: '',
topic: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b/:bucket/notificationConfigs');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
custom_attributes: {},
etag: '',
event_types: [],
id: '',
kind: '',
object_name_prefix: '',
payload_format: '',
selfLink: '',
topic: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/notificationConfigs',
headers: {'content-type': 'application/json'},
data: {
custom_attributes: {},
etag: '',
event_types: [],
id: '',
kind: '',
object_name_prefix: '',
payload_format: '',
selfLink: '',
topic: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/notificationConfigs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"custom_attributes":{},"etag":"","event_types":[],"id":"","kind":"","object_name_prefix":"","payload_format":"","selfLink":"","topic":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"custom_attributes": @{ },
@"etag": @"",
@"event_types": @[ ],
@"id": @"",
@"kind": @"",
@"object_name_prefix": @"",
@"payload_format": @"",
@"selfLink": @"",
@"topic": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/notificationConfigs"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/notificationConfigs" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/notificationConfigs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'custom_attributes' => [
],
'etag' => '',
'event_types' => [
],
'id' => '',
'kind' => '',
'object_name_prefix' => '',
'payload_format' => '',
'selfLink' => '',
'topic' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b/:bucket/notificationConfigs', [
'body' => '{
"custom_attributes": {},
"etag": "",
"event_types": [],
"id": "",
"kind": "",
"object_name_prefix": "",
"payload_format": "",
"selfLink": "",
"topic": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/notificationConfigs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'custom_attributes' => [
],
'etag' => '',
'event_types' => [
],
'id' => '',
'kind' => '',
'object_name_prefix' => '',
'payload_format' => '',
'selfLink' => '',
'topic' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'custom_attributes' => [
],
'etag' => '',
'event_types' => [
],
'id' => '',
'kind' => '',
'object_name_prefix' => '',
'payload_format' => '',
'selfLink' => '',
'topic' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/notificationConfigs');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/notificationConfigs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"custom_attributes": {},
"etag": "",
"event_types": [],
"id": "",
"kind": "",
"object_name_prefix": "",
"payload_format": "",
"selfLink": "",
"topic": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/notificationConfigs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"custom_attributes": {},
"etag": "",
"event_types": [],
"id": "",
"kind": "",
"object_name_prefix": "",
"payload_format": "",
"selfLink": "",
"topic": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/b/:bucket/notificationConfigs", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/notificationConfigs"
payload = {
"custom_attributes": {},
"etag": "",
"event_types": [],
"id": "",
"kind": "",
"object_name_prefix": "",
"payload_format": "",
"selfLink": "",
"topic": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/notificationConfigs"
payload <- "{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/notificationConfigs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/b/:bucket/notificationConfigs') do |req|
req.body = "{\n \"custom_attributes\": {},\n \"etag\": \"\",\n \"event_types\": [],\n \"id\": \"\",\n \"kind\": \"\",\n \"object_name_prefix\": \"\",\n \"payload_format\": \"\",\n \"selfLink\": \"\",\n \"topic\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/notificationConfigs";
let payload = json!({
"custom_attributes": json!({}),
"etag": "",
"event_types": (),
"id": "",
"kind": "",
"object_name_prefix": "",
"payload_format": "",
"selfLink": "",
"topic": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/b/:bucket/notificationConfigs \
--header 'content-type: application/json' \
--data '{
"custom_attributes": {},
"etag": "",
"event_types": [],
"id": "",
"kind": "",
"object_name_prefix": "",
"payload_format": "",
"selfLink": "",
"topic": ""
}'
echo '{
"custom_attributes": {},
"etag": "",
"event_types": [],
"id": "",
"kind": "",
"object_name_prefix": "",
"payload_format": "",
"selfLink": "",
"topic": ""
}' | \
http POST {{baseUrl}}/b/:bucket/notificationConfigs \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "custom_attributes": {},\n "etag": "",\n "event_types": [],\n "id": "",\n "kind": "",\n "object_name_prefix": "",\n "payload_format": "",\n "selfLink": "",\n "topic": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/notificationConfigs
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"custom_attributes": [],
"etag": "",
"event_types": [],
"id": "",
"kind": "",
"object_name_prefix": "",
"payload_format": "",
"selfLink": "",
"topic": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/notificationConfigs")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.notifications.list
{{baseUrl}}/b/:bucket/notificationConfigs
QUERY PARAMS
bucket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/notificationConfigs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/notificationConfigs")
require "http/client"
url = "{{baseUrl}}/b/:bucket/notificationConfigs"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/notificationConfigs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/notificationConfigs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/notificationConfigs"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/notificationConfigs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/notificationConfigs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/notificationConfigs"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/notificationConfigs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/notificationConfigs")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/notificationConfigs');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/notificationConfigs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/notificationConfigs';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/notificationConfigs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/notificationConfigs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/notificationConfigs',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/notificationConfigs'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/notificationConfigs');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/notificationConfigs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/notificationConfigs';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/notificationConfigs"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/notificationConfigs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/notificationConfigs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/notificationConfigs');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/notificationConfigs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/notificationConfigs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/notificationConfigs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/notificationConfigs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/notificationConfigs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/notificationConfigs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/notificationConfigs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/notificationConfigs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/notificationConfigs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/notificationConfigs";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/notificationConfigs
http GET {{baseUrl}}/b/:bucket/notificationConfigs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/notificationConfigs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/notificationConfigs")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
storage.objectAccessControls.delete
{{baseUrl}}/b/:bucket/o/:object/acl/:entity
QUERY PARAMS
bucket
object
entity
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object/acl/:entity");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object/acl/:entity"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object/acl/:entity");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/b/:bucket/o/:object/acl/:entity HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object/acl/:entity"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object/acl/:entity';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object/acl/:entity',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object/acl/:entity';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object/acl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object/acl/:entity" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object/acl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object/acl/:entity' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object/acl/:entity' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/b/:bucket/o/:object/acl/:entity")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/b/:bucket/o/:object/acl/:entity') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/b/:bucket/o/:object/acl/:entity
http DELETE {{baseUrl}}/b/:bucket/o/:object/acl/:entity
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object/acl/:entity
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object/acl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.objectAccessControls.get
{{baseUrl}}/b/:bucket/o/:object/acl/:entity
QUERY PARAMS
bucket
object
entity
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object/acl/:entity");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object/acl/:entity"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object/acl/:entity");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/o/:object/acl/:entity HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object/acl/:entity"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object/acl/:entity';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object/acl/:entity',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object/acl/:entity';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object/acl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object/acl/:entity" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object/acl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object/acl/:entity' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object/acl/:entity' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/o/:object/acl/:entity")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/o/:object/acl/:entity') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/o/:object/acl/:entity
http GET {{baseUrl}}/b/:bucket/o/:object/acl/:entity
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object/acl/:entity
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object/acl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.objectAccessControls.insert
{{baseUrl}}/b/:bucket/o/:object/acl
QUERY PARAMS
bucket
object
BODY json
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object/acl");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b/:bucket/o/:object/acl" {:content-type :json
:form-params {:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object/acl"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object/acl"),
Content = new StringContent("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object/acl");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object/acl"
payload := strings.NewReader("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b/:bucket/o/:object/acl HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 255
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b/:bucket/o/:object/acl")
.setHeader("content-type", "application/json")
.setBody("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object/acl"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b/:bucket/o/:object/acl")
.header("content-type", "application/json")
.body("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.asString();
const data = JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b/:bucket/o/:object/acl');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/o/:object/acl',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object/acl';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object/acl',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object/acl',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/o/:object/acl',
headers: {'content-type': 'application/json'},
body: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b/:bucket/o/:object/acl');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/o/:object/acl',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object/acl';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bucket": @"",
@"domain": @"",
@"email": @"",
@"entity": @"",
@"entityId": @"",
@"etag": @"",
@"generation": @"",
@"id": @"",
@"kind": @"",
@"object": @"",
@"projectTeam": @{ @"projectNumber": @"", @"team": @"" },
@"role": @"",
@"selfLink": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object/acl"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object/acl" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object/acl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b/:bucket/o/:object/acl', [
'body' => '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object/acl');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/o/:object/acl');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object/acl' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object/acl' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/b/:bucket/o/:object/acl", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object/acl"
payload = {
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object/acl"
payload <- "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object/acl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/b/:bucket/o/:object/acl') do |req|
req.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object/acl";
let payload = json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/b/:bucket/o/:object/acl \
--header 'content-type: application/json' \
--data '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
echo '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}' | \
http POST {{baseUrl}}/b/:bucket/o/:object/acl \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object/acl
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object/acl")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.objectAccessControls.list
{{baseUrl}}/b/:bucket/o/:object/acl
QUERY PARAMS
bucket
object
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object/acl");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/o/:object/acl")
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object/acl"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object/acl"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object/acl");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object/acl"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/o/:object/acl HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/o/:object/acl")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object/acl"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/o/:object/acl")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/o/:object/acl');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o/:object/acl'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object/acl';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object/acl',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object/acl',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o/:object/acl'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/o/:object/acl');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o/:object/acl'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object/acl';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object/acl"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object/acl" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object/acl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/o/:object/acl');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object/acl');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/o/:object/acl');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object/acl' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object/acl' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/o/:object/acl")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object/acl"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object/acl"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object/acl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/o/:object/acl') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object/acl";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/o/:object/acl
http GET {{baseUrl}}/b/:bucket/o/:object/acl
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object/acl
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object/acl")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PATCH
storage.objectAccessControls.patch
{{baseUrl}}/b/:bucket/o/:object/acl/:entity
QUERY PARAMS
bucket
object
entity
BODY json
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object/acl/:entity");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/b/:bucket/o/:object/acl/:entity" {:content-type :json
:form-params {:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object/acl/:entity"),
Content = new StringContent("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object/acl/:entity");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
payload := strings.NewReader("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/b/:bucket/o/:object/acl/:entity HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 255
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.setHeader("content-type", "application/json")
.setBody("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object/acl/:entity"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.header("content-type", "application/json")
.body("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.asString();
const data = JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object/acl/:entity';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object/acl/:entity',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity',
headers: {'content-type': 'application/json'},
body: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object/acl/:entity';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bucket": @"",
@"domain": @"",
@"email": @"",
@"entity": @"",
@"entityId": @"",
@"etag": @"",
@"generation": @"",
@"id": @"",
@"kind": @"",
@"object": @"",
@"projectTeam": @{ @"projectNumber": @"", @"team": @"" },
@"role": @"",
@"selfLink": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object/acl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object/acl/:entity" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object/acl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity', [
'body' => '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object/acl/:entity' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object/acl/:entity' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/b/:bucket/o/:object/acl/:entity", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
payload = {
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
payload <- "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/b/:bucket/o/:object/acl/:entity') do |req|
req.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity";
let payload = json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/b/:bucket/o/:object/acl/:entity \
--header 'content-type: application/json' \
--data '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
echo '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}' | \
http PATCH {{baseUrl}}/b/:bucket/o/:object/acl/:entity \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object/acl/:entity
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object/acl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
storage.objectAccessControls.update
{{baseUrl}}/b/:bucket/o/:object/acl/:entity
QUERY PARAMS
bucket
object
entity
BODY json
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object/acl/:entity");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/b/:bucket/o/:object/acl/:entity" {:content-type :json
:form-params {:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object/acl/:entity"),
Content = new StringContent("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object/acl/:entity");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
payload := strings.NewReader("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/b/:bucket/o/:object/acl/:entity HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 255
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.setHeader("content-type", "application/json")
.setBody("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object/acl/:entity"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.header("content-type", "application/json")
.body("{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
.asString();
const data = JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object/acl/:entity';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object/acl/:entity',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity',
headers: {'content-type': 'application/json'},
body: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/o/:object/acl/:entity',
headers: {'content-type': 'application/json'},
data: {
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object/acl/:entity';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bucket": @"",
@"domain": @"",
@"email": @"",
@"entity": @"",
@"entityId": @"",
@"etag": @"",
@"generation": @"",
@"id": @"",
@"kind": @"",
@"object": @"",
@"projectTeam": @{ @"projectNumber": @"", @"team": @"" },
@"role": @"",
@"selfLink": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object/acl/:entity"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object/acl/:entity" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object/acl/:entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/b/:bucket/o/:object/acl/:entity', [
'body' => '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/o/:object/acl/:entity');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object/acl/:entity' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object/acl/:entity' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/b/:bucket/o/:object/acl/:entity", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
payload = {
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object/acl/:entity"
payload <- "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object/acl/:entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/b/:bucket/o/:object/acl/:entity') do |req|
req.body = "{\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object/acl/:entity";
let payload = json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/b/:bucket/o/:object/acl/:entity \
--header 'content-type: application/json' \
--data '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}'
echo '{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}' | \
http PUT {{baseUrl}}/b/:bucket/o/:object/acl/:entity \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object/acl/:entity
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object/acl/:entity")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.objects.compose
{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose
QUERY PARAMS
destinationBucket
destinationObject
BODY json
{
"destination": {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
},
"kind": "",
"sourceObjects": [
{
"generation": "",
"name": "",
"objectPreconditions": {
"ifGenerationMatch": ""
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose" {:content-type :json
:form-params {:destination {:acl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:bucket ""
:cacheControl ""
:componentCount 0
:contentDisposition ""
:contentEncoding ""
:contentLanguage ""
:contentType ""
:crc32c ""
:customTime ""
:customerEncryption {:encryptionAlgorithm ""
:keySha256 ""}
:etag ""
:eventBasedHold false
:generation ""
:id ""
:kind ""
:kmsKeyName ""
:md5Hash ""
:mediaLink ""
:metadata {}
:metageneration ""
:name ""
:owner {:entity ""
:entityId ""}
:retentionExpirationTime ""
:selfLink ""
:size ""
:storageClass ""
:temporaryHold false
:timeCreated ""
:timeDeleted ""
:timeStorageClassUpdated ""
:updated ""}
:kind ""
:sourceObjects [{:generation ""
:name ""
:objectPreconditions {:ifGenerationMatch ""}}]}})
require "http/client"
url = "{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose"),
Content = new StringContent("{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose"
payload := strings.NewReader("{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b/:destinationBucket/o/:destinationObject/compose HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1385
{
"destination": {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
},
"kind": "",
"sourceObjects": [
{
"generation": "",
"name": "",
"objectPreconditions": {
"ifGenerationMatch": ""
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose")
.setHeader("content-type", "application/json")
.setBody("{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose")
.header("content-type", "application/json")
.body("{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
destination: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {
encryptionAlgorithm: '',
keySha256: ''
},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
},
kind: '',
sourceObjects: [
{
generation: '',
name: '',
objectPreconditions: {
ifGenerationMatch: ''
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose',
headers: {'content-type': 'application/json'},
data: {
destination: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
},
kind: '',
sourceObjects: [{generation: '', name: '', objectPreconditions: {ifGenerationMatch: ''}}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destination":{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"bucket":"","cacheControl":"","componentCount":0,"contentDisposition":"","contentEncoding":"","contentLanguage":"","contentType":"","crc32c":"","customTime":"","customerEncryption":{"encryptionAlgorithm":"","keySha256":""},"etag":"","eventBasedHold":false,"generation":"","id":"","kind":"","kmsKeyName":"","md5Hash":"","mediaLink":"","metadata":{},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"retentionExpirationTime":"","selfLink":"","size":"","storageClass":"","temporaryHold":false,"timeCreated":"","timeDeleted":"","timeStorageClassUpdated":"","updated":""},"kind":"","sourceObjects":[{"generation":"","name":"","objectPreconditions":{"ifGenerationMatch":""}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destination": {\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "bucket": "",\n "cacheControl": "",\n "componentCount": 0,\n "contentDisposition": "",\n "contentEncoding": "",\n "contentLanguage": "",\n "contentType": "",\n "crc32c": "",\n "customTime": "",\n "customerEncryption": {\n "encryptionAlgorithm": "",\n "keySha256": ""\n },\n "etag": "",\n "eventBasedHold": false,\n "generation": "",\n "id": "",\n "kind": "",\n "kmsKeyName": "",\n "md5Hash": "",\n "mediaLink": "",\n "metadata": {},\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "retentionExpirationTime": "",\n "selfLink": "",\n "size": "",\n "storageClass": "",\n "temporaryHold": false,\n "timeCreated": "",\n "timeDeleted": "",\n "timeStorageClassUpdated": "",\n "updated": ""\n },\n "kind": "",\n "sourceObjects": [\n {\n "generation": "",\n "name": "",\n "objectPreconditions": {\n "ifGenerationMatch": ""\n }\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:destinationBucket/o/:destinationObject/compose',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
destination: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
},
kind: '',
sourceObjects: [{generation: '', name: '', objectPreconditions: {ifGenerationMatch: ''}}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose',
headers: {'content-type': 'application/json'},
body: {
destination: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
},
kind: '',
sourceObjects: [{generation: '', name: '', objectPreconditions: {ifGenerationMatch: ''}}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destination: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {
encryptionAlgorithm: '',
keySha256: ''
},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
},
kind: '',
sourceObjects: [
{
generation: '',
name: '',
objectPreconditions: {
ifGenerationMatch: ''
}
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose',
headers: {'content-type': 'application/json'},
data: {
destination: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
},
kind: '',
sourceObjects: [{generation: '', name: '', objectPreconditions: {ifGenerationMatch: ''}}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destination":{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"bucket":"","cacheControl":"","componentCount":0,"contentDisposition":"","contentEncoding":"","contentLanguage":"","contentType":"","crc32c":"","customTime":"","customerEncryption":{"encryptionAlgorithm":"","keySha256":""},"etag":"","eventBasedHold":false,"generation":"","id":"","kind":"","kmsKeyName":"","md5Hash":"","mediaLink":"","metadata":{},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"retentionExpirationTime":"","selfLink":"","size":"","storageClass":"","temporaryHold":false,"timeCreated":"","timeDeleted":"","timeStorageClassUpdated":"","updated":""},"kind":"","sourceObjects":[{"generation":"","name":"","objectPreconditions":{"ifGenerationMatch":""}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destination": @{ @"acl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"generation": @"", @"id": @"", @"kind": @"", @"object": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ], @"bucket": @"", @"cacheControl": @"", @"componentCount": @0, @"contentDisposition": @"", @"contentEncoding": @"", @"contentLanguage": @"", @"contentType": @"", @"crc32c": @"", @"customTime": @"", @"customerEncryption": @{ @"encryptionAlgorithm": @"", @"keySha256": @"" }, @"etag": @"", @"eventBasedHold": @NO, @"generation": @"", @"id": @"", @"kind": @"", @"kmsKeyName": @"", @"md5Hash": @"", @"mediaLink": @"", @"metadata": @{ }, @"metageneration": @"", @"name": @"", @"owner": @{ @"entity": @"", @"entityId": @"" }, @"retentionExpirationTime": @"", @"selfLink": @"", @"size": @"", @"storageClass": @"", @"temporaryHold": @NO, @"timeCreated": @"", @"timeDeleted": @"", @"timeStorageClassUpdated": @"", @"updated": @"" },
@"kind": @"",
@"sourceObjects": @[ @{ @"generation": @"", @"name": @"", @"objectPreconditions": @{ @"ifGenerationMatch": @"" } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destination' => [
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
],
'kind' => '',
'sourceObjects' => [
[
'generation' => '',
'name' => '',
'objectPreconditions' => [
'ifGenerationMatch' => ''
]
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose', [
'body' => '{
"destination": {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
},
"kind": "",
"sourceObjects": [
{
"generation": "",
"name": "",
"objectPreconditions": {
"ifGenerationMatch": ""
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destination' => [
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
],
'kind' => '',
'sourceObjects' => [
[
'generation' => '',
'name' => '',
'objectPreconditions' => [
'ifGenerationMatch' => ''
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destination' => [
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
],
'kind' => '',
'sourceObjects' => [
[
'generation' => '',
'name' => '',
'objectPreconditions' => [
'ifGenerationMatch' => ''
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destination": {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
},
"kind": "",
"sourceObjects": [
{
"generation": "",
"name": "",
"objectPreconditions": {
"ifGenerationMatch": ""
}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destination": {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
},
"kind": "",
"sourceObjects": [
{
"generation": "",
"name": "",
"objectPreconditions": {
"ifGenerationMatch": ""
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/b/:destinationBucket/o/:destinationObject/compose", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose"
payload = {
"destination": {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": False,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": False,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
},
"kind": "",
"sourceObjects": [
{
"generation": "",
"name": "",
"objectPreconditions": { "ifGenerationMatch": "" }
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose"
payload <- "{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/b/:destinationBucket/o/:destinationObject/compose') do |req|
req.body = "{\n \"destination\": {\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n },\n \"kind\": \"\",\n \"sourceObjects\": [\n {\n \"generation\": \"\",\n \"name\": \"\",\n \"objectPreconditions\": {\n \"ifGenerationMatch\": \"\"\n }\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose";
let payload = json!({
"destination": json!({
"acl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": json!({
"encryptionAlgorithm": "",
"keySha256": ""
}),
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": json!({}),
"metageneration": "",
"name": "",
"owner": json!({
"entity": "",
"entityId": ""
}),
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}),
"kind": "",
"sourceObjects": (
json!({
"generation": "",
"name": "",
"objectPreconditions": json!({"ifGenerationMatch": ""})
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose \
--header 'content-type: application/json' \
--data '{
"destination": {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
},
"kind": "",
"sourceObjects": [
{
"generation": "",
"name": "",
"objectPreconditions": {
"ifGenerationMatch": ""
}
}
]
}'
echo '{
"destination": {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
},
"kind": "",
"sourceObjects": [
{
"generation": "",
"name": "",
"objectPreconditions": {
"ifGenerationMatch": ""
}
}
]
}' | \
http POST {{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destination": {\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "bucket": "",\n "cacheControl": "",\n "componentCount": 0,\n "contentDisposition": "",\n "contentEncoding": "",\n "contentLanguage": "",\n "contentType": "",\n "crc32c": "",\n "customTime": "",\n "customerEncryption": {\n "encryptionAlgorithm": "",\n "keySha256": ""\n },\n "etag": "",\n "eventBasedHold": false,\n "generation": "",\n "id": "",\n "kind": "",\n "kmsKeyName": "",\n "md5Hash": "",\n "mediaLink": "",\n "metadata": {},\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "retentionExpirationTime": "",\n "selfLink": "",\n "size": "",\n "storageClass": "",\n "temporaryHold": false,\n "timeCreated": "",\n "timeDeleted": "",\n "timeStorageClassUpdated": "",\n "updated": ""\n },\n "kind": "",\n "sourceObjects": [\n {\n "generation": "",\n "name": "",\n "objectPreconditions": {\n "ifGenerationMatch": ""\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destination": [
"acl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": [
"encryptionAlgorithm": "",
"keySha256": ""
],
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": [],
"metageneration": "",
"name": "",
"owner": [
"entity": "",
"entityId": ""
],
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
],
"kind": "",
"sourceObjects": [
[
"generation": "",
"name": "",
"objectPreconditions": ["ifGenerationMatch": ""]
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:destinationBucket/o/:destinationObject/compose")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.objects.copy
{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject
QUERY PARAMS
sourceBucket
sourceObject
destinationBucket
destinationObject
BODY json
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject" {:content-type :json
:form-params {:acl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:bucket ""
:cacheControl ""
:componentCount 0
:contentDisposition ""
:contentEncoding ""
:contentLanguage ""
:contentType ""
:crc32c ""
:customTime ""
:customerEncryption {:encryptionAlgorithm ""
:keySha256 ""}
:etag ""
:eventBasedHold false
:generation ""
:id ""
:kind ""
:kmsKeyName ""
:md5Hash ""
:mediaLink ""
:metadata {}
:metageneration ""
:name ""
:owner {:entity ""
:entityId ""}
:retentionExpirationTime ""
:selfLink ""
:size ""
:storageClass ""
:temporaryHold false
:timeCreated ""
:timeDeleted ""
:timeStorageClassUpdated ""
:updated ""}})
require "http/client"
url = "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject"),
Content = new StringContent("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject"
payload := strings.NewReader("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1083
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject")
.setHeader("content-type", "application/json")
.setBody("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject")
.header("content-type", "application/json")
.body("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
.asString();
const data = JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {
encryptionAlgorithm: '',
keySha256: ''
},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"bucket":"","cacheControl":"","componentCount":0,"contentDisposition":"","contentEncoding":"","contentLanguage":"","contentType":"","crc32c":"","customTime":"","customerEncryption":{"encryptionAlgorithm":"","keySha256":""},"etag":"","eventBasedHold":false,"generation":"","id":"","kind":"","kmsKeyName":"","md5Hash":"","mediaLink":"","metadata":{},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"retentionExpirationTime":"","selfLink":"","size":"","storageClass":"","temporaryHold":false,"timeCreated":"","timeDeleted":"","timeStorageClassUpdated":"","updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "bucket": "",\n "cacheControl": "",\n "componentCount": 0,\n "contentDisposition": "",\n "contentEncoding": "",\n "contentLanguage": "",\n "contentType": "",\n "crc32c": "",\n "customTime": "",\n "customerEncryption": {\n "encryptionAlgorithm": "",\n "keySha256": ""\n },\n "etag": "",\n "eventBasedHold": false,\n "generation": "",\n "id": "",\n "kind": "",\n "kmsKeyName": "",\n "md5Hash": "",\n "mediaLink": "",\n "metadata": {},\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "retentionExpirationTime": "",\n "selfLink": "",\n "size": "",\n "storageClass": "",\n "temporaryHold": false,\n "timeCreated": "",\n "timeDeleted": "",\n "timeStorageClassUpdated": "",\n "updated": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject',
headers: {'content-type': 'application/json'},
body: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {
encryptionAlgorithm: '',
keySha256: ''
},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"bucket":"","cacheControl":"","componentCount":0,"contentDisposition":"","contentEncoding":"","contentLanguage":"","contentType":"","crc32c":"","customTime":"","customerEncryption":{"encryptionAlgorithm":"","keySha256":""},"etag":"","eventBasedHold":false,"generation":"","id":"","kind":"","kmsKeyName":"","md5Hash":"","mediaLink":"","metadata":{},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"retentionExpirationTime":"","selfLink":"","size":"","storageClass":"","temporaryHold":false,"timeCreated":"","timeDeleted":"","timeStorageClassUpdated":"","updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"acl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"generation": @"", @"id": @"", @"kind": @"", @"object": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ],
@"bucket": @"",
@"cacheControl": @"",
@"componentCount": @0,
@"contentDisposition": @"",
@"contentEncoding": @"",
@"contentLanguage": @"",
@"contentType": @"",
@"crc32c": @"",
@"customTime": @"",
@"customerEncryption": @{ @"encryptionAlgorithm": @"", @"keySha256": @"" },
@"etag": @"",
@"eventBasedHold": @NO,
@"generation": @"",
@"id": @"",
@"kind": @"",
@"kmsKeyName": @"",
@"md5Hash": @"",
@"mediaLink": @"",
@"metadata": @{ },
@"metageneration": @"",
@"name": @"",
@"owner": @{ @"entity": @"", @"entityId": @"" },
@"retentionExpirationTime": @"",
@"selfLink": @"",
@"size": @"",
@"storageClass": @"",
@"temporaryHold": @NO,
@"timeCreated": @"",
@"timeDeleted": @"",
@"timeStorageClassUpdated": @"",
@"updated": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject', [
'body' => '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject"
payload = {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": False,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": False,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject"
payload <- "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject') do |req|
req.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject";
let payload = json!({
"acl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": json!({
"encryptionAlgorithm": "",
"keySha256": ""
}),
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": json!({}),
"metageneration": "",
"name": "",
"owner": json!({
"entity": "",
"entityId": ""
}),
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject \
--header 'content-type: application/json' \
--data '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
echo '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}' | \
http POST {{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "bucket": "",\n "cacheControl": "",\n "componentCount": 0,\n "contentDisposition": "",\n "contentEncoding": "",\n "contentLanguage": "",\n "contentType": "",\n "crc32c": "",\n "customTime": "",\n "customerEncryption": {\n "encryptionAlgorithm": "",\n "keySha256": ""\n },\n "etag": "",\n "eventBasedHold": false,\n "generation": "",\n "id": "",\n "kind": "",\n "kmsKeyName": "",\n "md5Hash": "",\n "mediaLink": "",\n "metadata": {},\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "retentionExpirationTime": "",\n "selfLink": "",\n "size": "",\n "storageClass": "",\n "temporaryHold": false,\n "timeCreated": "",\n "timeDeleted": "",\n "timeStorageClassUpdated": "",\n "updated": ""\n}' \
--output-document \
- {{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"acl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": [
"encryptionAlgorithm": "",
"keySha256": ""
],
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": [],
"metageneration": "",
"name": "",
"owner": [
"entity": "",
"entityId": ""
],
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/copyTo/b/:destinationBucket/o/:destinationObject")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
storage.objects.delete
{{baseUrl}}/b/:bucket/o/:object
QUERY PARAMS
bucket
object
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/b/:bucket/o/:object")
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/b/:bucket/o/:object HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/b/:bucket/o/:object")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/b/:bucket/o/:object")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/b/:bucket/o/:object');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/b/:bucket/o/:object'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'DELETE', url: '{{baseUrl}}/b/:bucket/o/:object'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/b/:bucket/o/:object');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'DELETE', url: '{{baseUrl}}/b/:bucket/o/:object'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/b/:bucket/o/:object');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/o/:object');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/b/:bucket/o/:object")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/b/:bucket/o/:object') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/b/:bucket/o/:object
http DELETE {{baseUrl}}/b/:bucket/o/:object
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.objects.get
{{baseUrl}}/b/:bucket/o/:object
QUERY PARAMS
bucket
object
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/o/:object")
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/o/:object HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/o/:object")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/o/:object")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/o/:object');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o/:object'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o/:object'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/o/:object');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o/:object'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/o/:object');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/o/:object');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/o/:object")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/o/:object') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/o/:object
http GET {{baseUrl}}/b/:bucket/o/:object
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.objects.getIamPolicy
{{baseUrl}}/b/:bucket/o/:object/iam
QUERY PARAMS
bucket
object
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object/iam");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/o/:object/iam")
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object/iam"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object/iam"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object/iam");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object/iam"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/o/:object/iam HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/o/:object/iam")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object/iam"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/iam")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/o/:object/iam")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/o/:object/iam');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o/:object/iam'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object/iam';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object/iam',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/iam")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object/iam',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o/:object/iam'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/o/:object/iam');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o/:object/iam'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object/iam';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object/iam"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object/iam" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object/iam",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/o/:object/iam');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object/iam');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/o/:object/iam');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object/iam' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object/iam' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/o/:object/iam")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object/iam"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object/iam"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object/iam")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/o/:object/iam') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object/iam";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/o/:object/iam
http GET {{baseUrl}}/b/:bucket/o/:object/iam
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object/iam
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object/iam")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.objects.insert
{{baseUrl}}/b/:bucket/o
QUERY PARAMS
bucket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b/:bucket/o")
require "http/client"
url = "{{baseUrl}}/b/:bucket/o"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b/:bucket/o HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b/:bucket/o")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b/:bucket/o")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b/:bucket/o');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/b/:bucket/o'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/b/:bucket/o'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b/:bucket/o');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'POST', url: '{{baseUrl}}/b/:bucket/o'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b/:bucket/o');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/o');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/b/:bucket/o")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/b/:bucket/o') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/b/:bucket/o
http POST {{baseUrl}}/b/:bucket/o
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/b/:bucket/o
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.objects.list
{{baseUrl}}/b/:bucket/o
QUERY PARAMS
bucket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/o")
require "http/client"
url = "{{baseUrl}}/b/:bucket/o"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/o HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/o")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/o")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/o');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/o');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/b/:bucket/o'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/o');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/o');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/o")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/o') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/b/:bucket/o
http GET {{baseUrl}}/b/:bucket/o
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/b/:bucket/o
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PATCH
storage.objects.patch
{{baseUrl}}/b/:bucket/o/:object
QUERY PARAMS
bucket
object
BODY json
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/b/:bucket/o/:object" {:content-type :json
:form-params {:acl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:bucket ""
:cacheControl ""
:componentCount 0
:contentDisposition ""
:contentEncoding ""
:contentLanguage ""
:contentType ""
:crc32c ""
:customTime ""
:customerEncryption {:encryptionAlgorithm ""
:keySha256 ""}
:etag ""
:eventBasedHold false
:generation ""
:id ""
:kind ""
:kmsKeyName ""
:md5Hash ""
:mediaLink ""
:metadata {}
:metageneration ""
:name ""
:owner {:entity ""
:entityId ""}
:retentionExpirationTime ""
:selfLink ""
:size ""
:storageClass ""
:temporaryHold false
:timeCreated ""
:timeDeleted ""
:timeStorageClassUpdated ""
:updated ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object"),
Content = new StringContent("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object"
payload := strings.NewReader("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/b/:bucket/o/:object HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1083
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/b/:bucket/o/:object")
.setHeader("content-type", "application/json")
.setBody("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/b/:bucket/o/:object")
.header("content-type", "application/json")
.body("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
.asString();
const data = JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {
encryptionAlgorithm: '',
keySha256: ''
},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/b/:bucket/o/:object');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/o/:object',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"bucket":"","cacheControl":"","componentCount":0,"contentDisposition":"","contentEncoding":"","contentLanguage":"","contentType":"","crc32c":"","customTime":"","customerEncryption":{"encryptionAlgorithm":"","keySha256":""},"etag":"","eventBasedHold":false,"generation":"","id":"","kind":"","kmsKeyName":"","md5Hash":"","mediaLink":"","metadata":{},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"retentionExpirationTime":"","selfLink":"","size":"","storageClass":"","temporaryHold":false,"timeCreated":"","timeDeleted":"","timeStorageClassUpdated":"","updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "bucket": "",\n "cacheControl": "",\n "componentCount": 0,\n "contentDisposition": "",\n "contentEncoding": "",\n "contentLanguage": "",\n "contentType": "",\n "crc32c": "",\n "customTime": "",\n "customerEncryption": {\n "encryptionAlgorithm": "",\n "keySha256": ""\n },\n "etag": "",\n "eventBasedHold": false,\n "generation": "",\n "id": "",\n "kind": "",\n "kmsKeyName": "",\n "md5Hash": "",\n "mediaLink": "",\n "metadata": {},\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "retentionExpirationTime": "",\n "selfLink": "",\n "size": "",\n "storageClass": "",\n "temporaryHold": false,\n "timeCreated": "",\n "timeDeleted": "",\n "timeStorageClassUpdated": "",\n "updated": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/o/:object',
headers: {'content-type': 'application/json'},
body: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/b/:bucket/o/:object');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {
encryptionAlgorithm: '',
keySha256: ''
},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/b/:bucket/o/:object',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"bucket":"","cacheControl":"","componentCount":0,"contentDisposition":"","contentEncoding":"","contentLanguage":"","contentType":"","crc32c":"","customTime":"","customerEncryption":{"encryptionAlgorithm":"","keySha256":""},"etag":"","eventBasedHold":false,"generation":"","id":"","kind":"","kmsKeyName":"","md5Hash":"","mediaLink":"","metadata":{},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"retentionExpirationTime":"","selfLink":"","size":"","storageClass":"","temporaryHold":false,"timeCreated":"","timeDeleted":"","timeStorageClassUpdated":"","updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"acl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"generation": @"", @"id": @"", @"kind": @"", @"object": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ],
@"bucket": @"",
@"cacheControl": @"",
@"componentCount": @0,
@"contentDisposition": @"",
@"contentEncoding": @"",
@"contentLanguage": @"",
@"contentType": @"",
@"crc32c": @"",
@"customTime": @"",
@"customerEncryption": @{ @"encryptionAlgorithm": @"", @"keySha256": @"" },
@"etag": @"",
@"eventBasedHold": @NO,
@"generation": @"",
@"id": @"",
@"kind": @"",
@"kmsKeyName": @"",
@"md5Hash": @"",
@"mediaLink": @"",
@"metadata": @{ },
@"metageneration": @"",
@"name": @"",
@"owner": @{ @"entity": @"", @"entityId": @"" },
@"retentionExpirationTime": @"",
@"selfLink": @"",
@"size": @"",
@"storageClass": @"",
@"temporaryHold": @NO,
@"timeCreated": @"",
@"timeDeleted": @"",
@"timeStorageClassUpdated": @"",
@"updated": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/b/:bucket/o/:object', [
'body' => '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/o/:object');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/b/:bucket/o/:object", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object"
payload = {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": False,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": False,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object"
payload <- "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/b/:bucket/o/:object') do |req|
req.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object";
let payload = json!({
"acl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": json!({
"encryptionAlgorithm": "",
"keySha256": ""
}),
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": json!({}),
"metageneration": "",
"name": "",
"owner": json!({
"entity": "",
"entityId": ""
}),
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/b/:bucket/o/:object \
--header 'content-type: application/json' \
--data '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
echo '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}' | \
http PATCH {{baseUrl}}/b/:bucket/o/:object \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "bucket": "",\n "cacheControl": "",\n "componentCount": 0,\n "contentDisposition": "",\n "contentEncoding": "",\n "contentLanguage": "",\n "contentType": "",\n "crc32c": "",\n "customTime": "",\n "customerEncryption": {\n "encryptionAlgorithm": "",\n "keySha256": ""\n },\n "etag": "",\n "eventBasedHold": false,\n "generation": "",\n "id": "",\n "kind": "",\n "kmsKeyName": "",\n "md5Hash": "",\n "mediaLink": "",\n "metadata": {},\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "retentionExpirationTime": "",\n "selfLink": "",\n "size": "",\n "storageClass": "",\n "temporaryHold": false,\n "timeCreated": "",\n "timeDeleted": "",\n "timeStorageClassUpdated": "",\n "updated": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"acl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": [
"encryptionAlgorithm": "",
"keySha256": ""
],
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": [],
"metageneration": "",
"name": "",
"owner": [
"entity": "",
"entityId": ""
],
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.objects.rewrite
{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject
QUERY PARAMS
sourceBucket
sourceObject
destinationBucket
destinationObject
BODY json
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject" {:content-type :json
:form-params {:acl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:bucket ""
:cacheControl ""
:componentCount 0
:contentDisposition ""
:contentEncoding ""
:contentLanguage ""
:contentType ""
:crc32c ""
:customTime ""
:customerEncryption {:encryptionAlgorithm ""
:keySha256 ""}
:etag ""
:eventBasedHold false
:generation ""
:id ""
:kind ""
:kmsKeyName ""
:md5Hash ""
:mediaLink ""
:metadata {}
:metageneration ""
:name ""
:owner {:entity ""
:entityId ""}
:retentionExpirationTime ""
:selfLink ""
:size ""
:storageClass ""
:temporaryHold false
:timeCreated ""
:timeDeleted ""
:timeStorageClassUpdated ""
:updated ""}})
require "http/client"
url = "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject"),
Content = new StringContent("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject"
payload := strings.NewReader("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1083
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject")
.setHeader("content-type", "application/json")
.setBody("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject")
.header("content-type", "application/json")
.body("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
.asString();
const data = JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {
encryptionAlgorithm: '',
keySha256: ''
},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"bucket":"","cacheControl":"","componentCount":0,"contentDisposition":"","contentEncoding":"","contentLanguage":"","contentType":"","crc32c":"","customTime":"","customerEncryption":{"encryptionAlgorithm":"","keySha256":""},"etag":"","eventBasedHold":false,"generation":"","id":"","kind":"","kmsKeyName":"","md5Hash":"","mediaLink":"","metadata":{},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"retentionExpirationTime":"","selfLink":"","size":"","storageClass":"","temporaryHold":false,"timeCreated":"","timeDeleted":"","timeStorageClassUpdated":"","updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "bucket": "",\n "cacheControl": "",\n "componentCount": 0,\n "contentDisposition": "",\n "contentEncoding": "",\n "contentLanguage": "",\n "contentType": "",\n "crc32c": "",\n "customTime": "",\n "customerEncryption": {\n "encryptionAlgorithm": "",\n "keySha256": ""\n },\n "etag": "",\n "eventBasedHold": false,\n "generation": "",\n "id": "",\n "kind": "",\n "kmsKeyName": "",\n "md5Hash": "",\n "mediaLink": "",\n "metadata": {},\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "retentionExpirationTime": "",\n "selfLink": "",\n "size": "",\n "storageClass": "",\n "temporaryHold": false,\n "timeCreated": "",\n "timeDeleted": "",\n "timeStorageClassUpdated": "",\n "updated": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject',
headers: {'content-type': 'application/json'},
body: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {
encryptionAlgorithm: '',
keySha256: ''
},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"bucket":"","cacheControl":"","componentCount":0,"contentDisposition":"","contentEncoding":"","contentLanguage":"","contentType":"","crc32c":"","customTime":"","customerEncryption":{"encryptionAlgorithm":"","keySha256":""},"etag":"","eventBasedHold":false,"generation":"","id":"","kind":"","kmsKeyName":"","md5Hash":"","mediaLink":"","metadata":{},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"retentionExpirationTime":"","selfLink":"","size":"","storageClass":"","temporaryHold":false,"timeCreated":"","timeDeleted":"","timeStorageClassUpdated":"","updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"acl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"generation": @"", @"id": @"", @"kind": @"", @"object": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ],
@"bucket": @"",
@"cacheControl": @"",
@"componentCount": @0,
@"contentDisposition": @"",
@"contentEncoding": @"",
@"contentLanguage": @"",
@"contentType": @"",
@"crc32c": @"",
@"customTime": @"",
@"customerEncryption": @{ @"encryptionAlgorithm": @"", @"keySha256": @"" },
@"etag": @"",
@"eventBasedHold": @NO,
@"generation": @"",
@"id": @"",
@"kind": @"",
@"kmsKeyName": @"",
@"md5Hash": @"",
@"mediaLink": @"",
@"metadata": @{ },
@"metageneration": @"",
@"name": @"",
@"owner": @{ @"entity": @"", @"entityId": @"" },
@"retentionExpirationTime": @"",
@"selfLink": @"",
@"size": @"",
@"storageClass": @"",
@"temporaryHold": @NO,
@"timeCreated": @"",
@"timeDeleted": @"",
@"timeStorageClassUpdated": @"",
@"updated": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject', [
'body' => '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject"
payload = {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": False,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": False,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject"
payload <- "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject') do |req|
req.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject";
let payload = json!({
"acl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": json!({
"encryptionAlgorithm": "",
"keySha256": ""
}),
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": json!({}),
"metageneration": "",
"name": "",
"owner": json!({
"entity": "",
"entityId": ""
}),
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject \
--header 'content-type: application/json' \
--data '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
echo '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}' | \
http POST {{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "bucket": "",\n "cacheControl": "",\n "componentCount": 0,\n "contentDisposition": "",\n "contentEncoding": "",\n "contentLanguage": "",\n "contentType": "",\n "crc32c": "",\n "customTime": "",\n "customerEncryption": {\n "encryptionAlgorithm": "",\n "keySha256": ""\n },\n "etag": "",\n "eventBasedHold": false,\n "generation": "",\n "id": "",\n "kind": "",\n "kmsKeyName": "",\n "md5Hash": "",\n "mediaLink": "",\n "metadata": {},\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "retentionExpirationTime": "",\n "selfLink": "",\n "size": "",\n "storageClass": "",\n "temporaryHold": false,\n "timeCreated": "",\n "timeDeleted": "",\n "timeStorageClassUpdated": "",\n "updated": ""\n}' \
--output-document \
- {{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"acl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": [
"encryptionAlgorithm": "",
"keySha256": ""
],
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": [],
"metageneration": "",
"name": "",
"owner": [
"entity": "",
"entityId": ""
],
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:sourceBucket/o/:sourceObject/rewriteTo/b/:destinationBucket/o/:destinationObject")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
storage.objects.setIamPolicy
{{baseUrl}}/b/:bucket/o/:object/iam
QUERY PARAMS
bucket
object
BODY json
{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object/iam");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/b/:bucket/o/:object/iam" {:content-type :json
:form-params {:bindings [{:condition {:description ""
:expression ""
:location ""
:title ""}
:members []
:role ""}]
:etag ""
:kind ""
:resourceId ""
:version 0}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object/iam"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object/iam"),
Content = new StringContent("{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object/iam");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object/iam"
payload := strings.NewReader("{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/b/:bucket/o/:object/iam HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 264
{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/b/:bucket/o/:object/iam")
.setHeader("content-type", "application/json")
.setBody("{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object/iam"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/iam")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/b/:bucket/o/:object/iam")
.header("content-type", "application/json")
.body("{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}")
.asString();
const data = JSON.stringify({
bindings: [
{
condition: {
description: '',
expression: '',
location: '',
title: ''
},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/b/:bucket/o/:object/iam');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/o/:object/iam',
headers: {'content-type': 'application/json'},
data: {
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object/iam';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bindings":[{"condition":{"description":"","expression":"","location":"","title":""},"members":[],"role":""}],"etag":"","kind":"","resourceId":"","version":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object/iam',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bindings": [\n {\n "condition": {\n "description": "",\n "expression": "",\n "location": "",\n "title": ""\n },\n "members": [],\n "role": ""\n }\n ],\n "etag": "",\n "kind": "",\n "resourceId": "",\n "version": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/iam")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object/iam',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/o/:object/iam',
headers: {'content-type': 'application/json'},
body: {
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/b/:bucket/o/:object/iam');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bindings: [
{
condition: {
description: '',
expression: '',
location: '',
title: ''
},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/o/:object/iam',
headers: {'content-type': 'application/json'},
data: {
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
kind: '',
resourceId: '',
version: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object/iam';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bindings":[{"condition":{"description":"","expression":"","location":"","title":""},"members":[],"role":""}],"etag":"","kind":"","resourceId":"","version":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bindings": @[ @{ @"condition": @{ @"description": @"", @"expression": @"", @"location": @"", @"title": @"" }, @"members": @[ ], @"role": @"" } ],
@"etag": @"",
@"kind": @"",
@"resourceId": @"",
@"version": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object/iam"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object/iam" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object/iam",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'kind' => '',
'resourceId' => '',
'version' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/b/:bucket/o/:object/iam', [
'body' => '{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object/iam');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'kind' => '',
'resourceId' => '',
'version' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'kind' => '',
'resourceId' => '',
'version' => 0
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/o/:object/iam');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object/iam' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object/iam' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/b/:bucket/o/:object/iam", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object/iam"
payload = {
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object/iam"
payload <- "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object/iam")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/b/:bucket/o/:object/iam') do |req|
req.body = "{\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"kind\": \"\",\n \"resourceId\": \"\",\n \"version\": 0\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object/iam";
let payload = json!({
"bindings": (
json!({
"condition": json!({
"description": "",
"expression": "",
"location": "",
"title": ""
}),
"members": (),
"role": ""
})
),
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/b/:bucket/o/:object/iam \
--header 'content-type: application/json' \
--data '{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}'
echo '{
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
}' | \
http PUT {{baseUrl}}/b/:bucket/o/:object/iam \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "bindings": [\n {\n "condition": {\n "description": "",\n "expression": "",\n "location": "",\n "title": ""\n },\n "members": [],\n "role": ""\n }\n ],\n "etag": "",\n "kind": "",\n "resourceId": "",\n "version": 0\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object/iam
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bindings": [
[
"condition": [
"description": "",
"expression": "",
"location": "",
"title": ""
],
"members": [],
"role": ""
]
],
"etag": "",
"kind": "",
"resourceId": "",
"version": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object/iam")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.objects.testIamPermissions
{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions
QUERY PARAMS
permissions
bucket
object
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions" {:query-params {:permissions ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/b/:bucket/o/:object/iam/testPermissions?permissions= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions="))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions',
params: {permissions: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object/iam/testPermissions?permissions=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions',
qs: {permissions: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions');
req.query({
permissions: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions',
params: {permissions: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=');
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'permissions' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'permissions' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/b/:bucket/o/:object/iam/testPermissions?permissions=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions"
querystring = {"permissions":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions"
queryString <- list(permissions = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/b/:bucket/o/:object/iam/testPermissions') do |req|
req.params['permissions'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions";
let querystring = [
("permissions", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions='
http GET '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object/iam/testPermissions?permissions=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
storage.objects.update
{{baseUrl}}/b/:bucket/o/:object
QUERY PARAMS
bucket
object
BODY json
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/:object");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/b/:bucket/o/:object" {:content-type :json
:form-params {:acl [{:bucket ""
:domain ""
:email ""
:entity ""
:entityId ""
:etag ""
:generation ""
:id ""
:kind ""
:object ""
:projectTeam {:projectNumber ""
:team ""}
:role ""
:selfLink ""}]
:bucket ""
:cacheControl ""
:componentCount 0
:contentDisposition ""
:contentEncoding ""
:contentLanguage ""
:contentType ""
:crc32c ""
:customTime ""
:customerEncryption {:encryptionAlgorithm ""
:keySha256 ""}
:etag ""
:eventBasedHold false
:generation ""
:id ""
:kind ""
:kmsKeyName ""
:md5Hash ""
:mediaLink ""
:metadata {}
:metageneration ""
:name ""
:owner {:entity ""
:entityId ""}
:retentionExpirationTime ""
:selfLink ""
:size ""
:storageClass ""
:temporaryHold false
:timeCreated ""
:timeDeleted ""
:timeStorageClassUpdated ""
:updated ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/:object"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/:object"),
Content = new StringContent("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/:object");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/:object"
payload := strings.NewReader("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/b/:bucket/o/:object HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1083
{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/b/:bucket/o/:object")
.setHeader("content-type", "application/json")
.setBody("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/:object"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/b/:bucket/o/:object")
.header("content-type", "application/json")
.body("{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
.asString();
const data = JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {
encryptionAlgorithm: '',
keySha256: ''
},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/b/:bucket/o/:object');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/o/:object',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/:object';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"bucket":"","cacheControl":"","componentCount":0,"contentDisposition":"","contentEncoding":"","contentLanguage":"","contentType":"","crc32c":"","customTime":"","customerEncryption":{"encryptionAlgorithm":"","keySha256":""},"etag":"","eventBasedHold":false,"generation":"","id":"","kind":"","kmsKeyName":"","md5Hash":"","mediaLink":"","metadata":{},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"retentionExpirationTime":"","selfLink":"","size":"","storageClass":"","temporaryHold":false,"timeCreated":"","timeDeleted":"","timeStorageClassUpdated":"","updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/:object',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "bucket": "",\n "cacheControl": "",\n "componentCount": 0,\n "contentDisposition": "",\n "contentEncoding": "",\n "contentLanguage": "",\n "contentType": "",\n "crc32c": "",\n "customTime": "",\n "customerEncryption": {\n "encryptionAlgorithm": "",\n "keySha256": ""\n },\n "etag": "",\n "eventBasedHold": false,\n "generation": "",\n "id": "",\n "kind": "",\n "kmsKeyName": "",\n "md5Hash": "",\n "mediaLink": "",\n "metadata": {},\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "retentionExpirationTime": "",\n "selfLink": "",\n "size": "",\n "storageClass": "",\n "temporaryHold": false,\n "timeCreated": "",\n "timeDeleted": "",\n "timeStorageClassUpdated": "",\n "updated": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/:object")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/:object',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/o/:object',
headers: {'content-type': 'application/json'},
body: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/b/:bucket/o/:object');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {
projectNumber: '',
team: ''
},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {
encryptionAlgorithm: '',
keySha256: ''
},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {
entity: '',
entityId: ''
},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/b/:bucket/o/:object',
headers: {'content-type': 'application/json'},
data: {
acl: [
{
bucket: '',
domain: '',
email: '',
entity: '',
entityId: '',
etag: '',
generation: '',
id: '',
kind: '',
object: '',
projectTeam: {projectNumber: '', team: ''},
role: '',
selfLink: ''
}
],
bucket: '',
cacheControl: '',
componentCount: 0,
contentDisposition: '',
contentEncoding: '',
contentLanguage: '',
contentType: '',
crc32c: '',
customTime: '',
customerEncryption: {encryptionAlgorithm: '', keySha256: ''},
etag: '',
eventBasedHold: false,
generation: '',
id: '',
kind: '',
kmsKeyName: '',
md5Hash: '',
mediaLink: '',
metadata: {},
metageneration: '',
name: '',
owner: {entity: '', entityId: ''},
retentionExpirationTime: '',
selfLink: '',
size: '',
storageClass: '',
temporaryHold: false,
timeCreated: '',
timeDeleted: '',
timeStorageClassUpdated: '',
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/:object';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"acl":[{"bucket":"","domain":"","email":"","entity":"","entityId":"","etag":"","generation":"","id":"","kind":"","object":"","projectTeam":{"projectNumber":"","team":""},"role":"","selfLink":""}],"bucket":"","cacheControl":"","componentCount":0,"contentDisposition":"","contentEncoding":"","contentLanguage":"","contentType":"","crc32c":"","customTime":"","customerEncryption":{"encryptionAlgorithm":"","keySha256":""},"etag":"","eventBasedHold":false,"generation":"","id":"","kind":"","kmsKeyName":"","md5Hash":"","mediaLink":"","metadata":{},"metageneration":"","name":"","owner":{"entity":"","entityId":""},"retentionExpirationTime":"","selfLink":"","size":"","storageClass":"","temporaryHold":false,"timeCreated":"","timeDeleted":"","timeStorageClassUpdated":"","updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"acl": @[ @{ @"bucket": @"", @"domain": @"", @"email": @"", @"entity": @"", @"entityId": @"", @"etag": @"", @"generation": @"", @"id": @"", @"kind": @"", @"object": @"", @"projectTeam": @{ @"projectNumber": @"", @"team": @"" }, @"role": @"", @"selfLink": @"" } ],
@"bucket": @"",
@"cacheControl": @"",
@"componentCount": @0,
@"contentDisposition": @"",
@"contentEncoding": @"",
@"contentLanguage": @"",
@"contentType": @"",
@"crc32c": @"",
@"customTime": @"",
@"customerEncryption": @{ @"encryptionAlgorithm": @"", @"keySha256": @"" },
@"etag": @"",
@"eventBasedHold": @NO,
@"generation": @"",
@"id": @"",
@"kind": @"",
@"kmsKeyName": @"",
@"md5Hash": @"",
@"mediaLink": @"",
@"metadata": @{ },
@"metageneration": @"",
@"name": @"",
@"owner": @{ @"entity": @"", @"entityId": @"" },
@"retentionExpirationTime": @"",
@"selfLink": @"",
@"size": @"",
@"storageClass": @"",
@"temporaryHold": @NO,
@"timeCreated": @"",
@"timeDeleted": @"",
@"timeStorageClassUpdated": @"",
@"updated": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/:object"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/:object" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/:object",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/b/:bucket/o/:object', [
'body' => '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/:object');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acl' => [
[
'bucket' => '',
'domain' => '',
'email' => '',
'entity' => '',
'entityId' => '',
'etag' => '',
'generation' => '',
'id' => '',
'kind' => '',
'object' => '',
'projectTeam' => [
'projectNumber' => '',
'team' => ''
],
'role' => '',
'selfLink' => ''
]
],
'bucket' => '',
'cacheControl' => '',
'componentCount' => 0,
'contentDisposition' => '',
'contentEncoding' => '',
'contentLanguage' => '',
'contentType' => '',
'crc32c' => '',
'customTime' => '',
'customerEncryption' => [
'encryptionAlgorithm' => '',
'keySha256' => ''
],
'etag' => '',
'eventBasedHold' => null,
'generation' => '',
'id' => '',
'kind' => '',
'kmsKeyName' => '',
'md5Hash' => '',
'mediaLink' => '',
'metadata' => [
],
'metageneration' => '',
'name' => '',
'owner' => [
'entity' => '',
'entityId' => ''
],
'retentionExpirationTime' => '',
'selfLink' => '',
'size' => '',
'storageClass' => '',
'temporaryHold' => null,
'timeCreated' => '',
'timeDeleted' => '',
'timeStorageClassUpdated' => '',
'updated' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/o/:object');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/:object' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/:object' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/b/:bucket/o/:object", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/:object"
payload = {
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": False,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": False,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/:object"
payload <- "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/:object")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/b/:bucket/o/:object') do |req|
req.body = "{\n \"acl\": [\n {\n \"bucket\": \"\",\n \"domain\": \"\",\n \"email\": \"\",\n \"entity\": \"\",\n \"entityId\": \"\",\n \"etag\": \"\",\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"object\": \"\",\n \"projectTeam\": {\n \"projectNumber\": \"\",\n \"team\": \"\"\n },\n \"role\": \"\",\n \"selfLink\": \"\"\n }\n ],\n \"bucket\": \"\",\n \"cacheControl\": \"\",\n \"componentCount\": 0,\n \"contentDisposition\": \"\",\n \"contentEncoding\": \"\",\n \"contentLanguage\": \"\",\n \"contentType\": \"\",\n \"crc32c\": \"\",\n \"customTime\": \"\",\n \"customerEncryption\": {\n \"encryptionAlgorithm\": \"\",\n \"keySha256\": \"\"\n },\n \"etag\": \"\",\n \"eventBasedHold\": false,\n \"generation\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"kmsKeyName\": \"\",\n \"md5Hash\": \"\",\n \"mediaLink\": \"\",\n \"metadata\": {},\n \"metageneration\": \"\",\n \"name\": \"\",\n \"owner\": {\n \"entity\": \"\",\n \"entityId\": \"\"\n },\n \"retentionExpirationTime\": \"\",\n \"selfLink\": \"\",\n \"size\": \"\",\n \"storageClass\": \"\",\n \"temporaryHold\": false,\n \"timeCreated\": \"\",\n \"timeDeleted\": \"\",\n \"timeStorageClassUpdated\": \"\",\n \"updated\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/:object";
let payload = json!({
"acl": (
json!({
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": json!({
"projectNumber": "",
"team": ""
}),
"role": "",
"selfLink": ""
})
),
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": json!({
"encryptionAlgorithm": "",
"keySha256": ""
}),
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": json!({}),
"metageneration": "",
"name": "",
"owner": json!({
"entity": "",
"entityId": ""
}),
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/b/:bucket/o/:object \
--header 'content-type: application/json' \
--data '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}'
echo '{
"acl": [
{
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": {
"projectNumber": "",
"team": ""
},
"role": "",
"selfLink": ""
}
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": {
"encryptionAlgorithm": "",
"keySha256": ""
},
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": {},
"metageneration": "",
"name": "",
"owner": {
"entity": "",
"entityId": ""
},
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
}' | \
http PUT {{baseUrl}}/b/:bucket/o/:object \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "acl": [\n {\n "bucket": "",\n "domain": "",\n "email": "",\n "entity": "",\n "entityId": "",\n "etag": "",\n "generation": "",\n "id": "",\n "kind": "",\n "object": "",\n "projectTeam": {\n "projectNumber": "",\n "team": ""\n },\n "role": "",\n "selfLink": ""\n }\n ],\n "bucket": "",\n "cacheControl": "",\n "componentCount": 0,\n "contentDisposition": "",\n "contentEncoding": "",\n "contentLanguage": "",\n "contentType": "",\n "crc32c": "",\n "customTime": "",\n "customerEncryption": {\n "encryptionAlgorithm": "",\n "keySha256": ""\n },\n "etag": "",\n "eventBasedHold": false,\n "generation": "",\n "id": "",\n "kind": "",\n "kmsKeyName": "",\n "md5Hash": "",\n "mediaLink": "",\n "metadata": {},\n "metageneration": "",\n "name": "",\n "owner": {\n "entity": "",\n "entityId": ""\n },\n "retentionExpirationTime": "",\n "selfLink": "",\n "size": "",\n "storageClass": "",\n "temporaryHold": false,\n "timeCreated": "",\n "timeDeleted": "",\n "timeStorageClassUpdated": "",\n "updated": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/o/:object
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"acl": [
[
"bucket": "",
"domain": "",
"email": "",
"entity": "",
"entityId": "",
"etag": "",
"generation": "",
"id": "",
"kind": "",
"object": "",
"projectTeam": [
"projectNumber": "",
"team": ""
],
"role": "",
"selfLink": ""
]
],
"bucket": "",
"cacheControl": "",
"componentCount": 0,
"contentDisposition": "",
"contentEncoding": "",
"contentLanguage": "",
"contentType": "",
"crc32c": "",
"customTime": "",
"customerEncryption": [
"encryptionAlgorithm": "",
"keySha256": ""
],
"etag": "",
"eventBasedHold": false,
"generation": "",
"id": "",
"kind": "",
"kmsKeyName": "",
"md5Hash": "",
"mediaLink": "",
"metadata": [],
"metageneration": "",
"name": "",
"owner": [
"entity": "",
"entityId": ""
],
"retentionExpirationTime": "",
"selfLink": "",
"size": "",
"storageClass": "",
"temporaryHold": false,
"timeCreated": "",
"timeDeleted": "",
"timeStorageClassUpdated": "",
"updated": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/:object")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.objects.watchAll
{{baseUrl}}/b/:bucket/o/watch
QUERY PARAMS
bucket
BODY json
{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/b/:bucket/o/watch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/b/:bucket/o/watch" {:content-type :json
:form-params {:address ""
:expiration ""
:id ""
:kind ""
:params {}
:payload false
:resourceId ""
:resourceUri ""
:token ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/b/:bucket/o/watch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/b/:bucket/o/watch"),
Content = new StringContent("{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/b/:bucket/o/watch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/b/:bucket/o/watch"
payload := strings.NewReader("{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/b/:bucket/o/watch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 171
{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/b/:bucket/o/watch")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/b/:bucket/o/watch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/watch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/b/:bucket/o/watch")
.header("content-type", "application/json")
.body("{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/b/:bucket/o/watch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/o/watch',
headers: {'content-type': 'application/json'},
data: {
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/b/:bucket/o/watch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"address":"","expiration":"","id":"","kind":"","params":{},"payload":false,"resourceId":"","resourceUri":"","token":"","type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/b/:bucket/o/watch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": "",\n "expiration": "",\n "id": "",\n "kind": "",\n "params": {},\n "payload": false,\n "resourceId": "",\n "resourceUri": "",\n "token": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/b/:bucket/o/watch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/b/:bucket/o/watch',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/o/watch',
headers: {'content-type': 'application/json'},
body: {
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/b/:bucket/o/watch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/b/:bucket/o/watch',
headers: {'content-type': 'application/json'},
data: {
address: '',
expiration: '',
id: '',
kind: '',
params: {},
payload: false,
resourceId: '',
resourceUri: '',
token: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/b/:bucket/o/watch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"address":"","expiration":"","id":"","kind":"","params":{},"payload":false,"resourceId":"","resourceUri":"","token":"","type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"address": @"",
@"expiration": @"",
@"id": @"",
@"kind": @"",
@"params": @{ },
@"payload": @NO,
@"resourceId": @"",
@"resourceUri": @"",
@"token": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/b/:bucket/o/watch"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/b/:bucket/o/watch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/b/:bucket/o/watch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => '',
'expiration' => '',
'id' => '',
'kind' => '',
'params' => [
],
'payload' => null,
'resourceId' => '',
'resourceUri' => '',
'token' => '',
'type' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/b/:bucket/o/watch', [
'body' => '{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/b/:bucket/o/watch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => '',
'expiration' => '',
'id' => '',
'kind' => '',
'params' => [
],
'payload' => null,
'resourceId' => '',
'resourceUri' => '',
'token' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => '',
'expiration' => '',
'id' => '',
'kind' => '',
'params' => [
],
'payload' => null,
'resourceId' => '',
'resourceUri' => '',
'token' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/b/:bucket/o/watch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/b/:bucket/o/watch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/b/:bucket/o/watch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/b/:bucket/o/watch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/b/:bucket/o/watch"
payload = {
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": False,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/b/:bucket/o/watch"
payload <- "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/b/:bucket/o/watch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/b/:bucket/o/watch') do |req|
req.body = "{\n \"address\": \"\",\n \"expiration\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"params\": {},\n \"payload\": false,\n \"resourceId\": \"\",\n \"resourceUri\": \"\",\n \"token\": \"\",\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/b/:bucket/o/watch";
let payload = json!({
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": json!({}),
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/b/:bucket/o/watch \
--header 'content-type: application/json' \
--data '{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}'
echo '{
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": {},
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
}' | \
http POST {{baseUrl}}/b/:bucket/o/watch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "address": "",\n "expiration": "",\n "id": "",\n "kind": "",\n "params": {},\n "payload": false,\n "resourceId": "",\n "resourceUri": "",\n "token": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/b/:bucket/o/watch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"address": "",
"expiration": "",
"id": "",
"kind": "",
"params": [],
"payload": false,
"resourceId": "",
"resourceUri": "",
"token": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/b/:bucket/o/watch")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
storage.projects.hmacKeys.create
{{baseUrl}}/projects/:projectId/hmacKeys
QUERY PARAMS
serviceAccountEmail
projectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/projects/:projectId/hmacKeys" {:query-params {:serviceAccountEmail ""}})
require "http/client"
url = "{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/projects/:projectId/hmacKeys?serviceAccountEmail= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/projects/:projectId/hmacKeys',
params: {serviceAccountEmail: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/projects/:projectId/hmacKeys?serviceAccountEmail=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/projects/:projectId/hmacKeys',
qs: {serviceAccountEmail: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/projects/:projectId/hmacKeys');
req.query({
serviceAccountEmail: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/projects/:projectId/hmacKeys',
params: {serviceAccountEmail: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=');
echo $response->getBody();
setUrl('{{baseUrl}}/projects/:projectId/hmacKeys');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'serviceAccountEmail' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/projects/:projectId/hmacKeys');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'serviceAccountEmail' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/projects/:projectId/hmacKeys?serviceAccountEmail=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/projects/:projectId/hmacKeys"
querystring = {"serviceAccountEmail":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/projects/:projectId/hmacKeys"
queryString <- list(serviceAccountEmail = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/projects/:projectId/hmacKeys') do |req|
req.params['serviceAccountEmail'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/projects/:projectId/hmacKeys";
let querystring = [
("serviceAccountEmail", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail='
http POST '{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/projects/:projectId/hmacKeys?serviceAccountEmail=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
storage.projects.hmacKeys.delete
{{baseUrl}}/projects/:projectId/hmacKeys/:accessId
QUERY PARAMS
projectId
accessId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
require "http/client"
url = "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/projects/:projectId/hmacKeys/:accessId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/projects/:projectId/hmacKeys/:accessId',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/projects/:projectId/hmacKeys/:accessId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
echo $response->getBody();
setUrl('{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/projects/:projectId/hmacKeys/:accessId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/projects/:projectId/hmacKeys/:accessId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/projects/:projectId/hmacKeys/:accessId
http DELETE {{baseUrl}}/projects/:projectId/hmacKeys/:accessId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/projects/:projectId/hmacKeys/:accessId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.projects.hmacKeys.get
{{baseUrl}}/projects/:projectId/hmacKeys/:accessId
QUERY PARAMS
projectId
accessId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
require "http/client"
url = "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/projects/:projectId/hmacKeys/:accessId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/projects/:projectId/hmacKeys/:accessId',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/projects/:projectId/hmacKeys/:accessId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
echo $response->getBody();
setUrl('{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/projects/:projectId/hmacKeys/:accessId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/projects/:projectId/hmacKeys/:accessId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/projects/:projectId/hmacKeys/:accessId
http GET {{baseUrl}}/projects/:projectId/hmacKeys/:accessId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/projects/:projectId/hmacKeys/:accessId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.projects.hmacKeys.list
{{baseUrl}}/projects/:projectId/hmacKeys
QUERY PARAMS
projectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/projects/:projectId/hmacKeys");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/projects/:projectId/hmacKeys")
require "http/client"
url = "{{baseUrl}}/projects/:projectId/hmacKeys"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/projects/:projectId/hmacKeys"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/projects/:projectId/hmacKeys");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/projects/:projectId/hmacKeys"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/projects/:projectId/hmacKeys HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/projects/:projectId/hmacKeys")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/projects/:projectId/hmacKeys"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/projects/:projectId/hmacKeys")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/projects/:projectId/hmacKeys")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/projects/:projectId/hmacKeys');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/projects/:projectId/hmacKeys'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/projects/:projectId/hmacKeys';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/projects/:projectId/hmacKeys',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/projects/:projectId/hmacKeys")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/projects/:projectId/hmacKeys',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/projects/:projectId/hmacKeys'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/projects/:projectId/hmacKeys');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/projects/:projectId/hmacKeys'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/projects/:projectId/hmacKeys';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/projects/:projectId/hmacKeys"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/projects/:projectId/hmacKeys" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/projects/:projectId/hmacKeys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/projects/:projectId/hmacKeys');
echo $response->getBody();
setUrl('{{baseUrl}}/projects/:projectId/hmacKeys');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/projects/:projectId/hmacKeys');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/projects/:projectId/hmacKeys' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/projects/:projectId/hmacKeys' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/projects/:projectId/hmacKeys")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/projects/:projectId/hmacKeys"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/projects/:projectId/hmacKeys"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/projects/:projectId/hmacKeys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/projects/:projectId/hmacKeys') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/projects/:projectId/hmacKeys";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/projects/:projectId/hmacKeys
http GET {{baseUrl}}/projects/:projectId/hmacKeys
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/projects/:projectId/hmacKeys
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/projects/:projectId/hmacKeys")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
storage.projects.hmacKeys.update
{{baseUrl}}/projects/:projectId/hmacKeys/:accessId
QUERY PARAMS
projectId
accessId
BODY json
{
"accessId": "",
"etag": "",
"id": "",
"kind": "",
"projectId": "",
"selfLink": "",
"serviceAccountEmail": "",
"state": "",
"timeCreated": "",
"updated": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId" {:content-type :json
:form-params {:accessId ""
:etag ""
:id ""
:kind ""
:projectId ""
:selfLink ""
:serviceAccountEmail ""
:state ""
:timeCreated ""
:updated ""}})
require "http/client"
url = "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"),
Content = new StringContent("{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
payload := strings.NewReader("{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/projects/:projectId/hmacKeys/:accessId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 179
{
"accessId": "",
"etag": "",
"id": "",
"kind": "",
"projectId": "",
"selfLink": "",
"serviceAccountEmail": "",
"state": "",
"timeCreated": "",
"updated": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.setHeader("content-type", "application/json")
.setBody("{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.header("content-type", "application/json")
.body("{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}")
.asString();
const data = JSON.stringify({
accessId: '',
etag: '',
id: '',
kind: '',
projectId: '',
selfLink: '',
serviceAccountEmail: '',
state: '',
timeCreated: '',
updated: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId',
headers: {'content-type': 'application/json'},
data: {
accessId: '',
etag: '',
id: '',
kind: '',
projectId: '',
selfLink: '',
serviceAccountEmail: '',
state: '',
timeCreated: '',
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accessId":"","etag":"","id":"","kind":"","projectId":"","selfLink":"","serviceAccountEmail":"","state":"","timeCreated":"","updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accessId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectId": "",\n "selfLink": "",\n "serviceAccountEmail": "",\n "state": "",\n "timeCreated": "",\n "updated": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/projects/:projectId/hmacKeys/:accessId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
accessId: '',
etag: '',
id: '',
kind: '',
projectId: '',
selfLink: '',
serviceAccountEmail: '',
state: '',
timeCreated: '',
updated: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId',
headers: {'content-type': 'application/json'},
body: {
accessId: '',
etag: '',
id: '',
kind: '',
projectId: '',
selfLink: '',
serviceAccountEmail: '',
state: '',
timeCreated: '',
updated: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accessId: '',
etag: '',
id: '',
kind: '',
projectId: '',
selfLink: '',
serviceAccountEmail: '',
state: '',
timeCreated: '',
updated: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId',
headers: {'content-type': 'application/json'},
data: {
accessId: '',
etag: '',
id: '',
kind: '',
projectId: '',
selfLink: '',
serviceAccountEmail: '',
state: '',
timeCreated: '',
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accessId":"","etag":"","id":"","kind":"","projectId":"","selfLink":"","serviceAccountEmail":"","state":"","timeCreated":"","updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accessId": @"",
@"etag": @"",
@"id": @"",
@"kind": @"",
@"projectId": @"",
@"selfLink": @"",
@"serviceAccountEmail": @"",
@"state": @"",
@"timeCreated": @"",
@"updated": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/projects/:projectId/hmacKeys/:accessId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'accessId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectId' => '',
'selfLink' => '',
'serviceAccountEmail' => '',
'state' => '',
'timeCreated' => '',
'updated' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId', [
'body' => '{
"accessId": "",
"etag": "",
"id": "",
"kind": "",
"projectId": "",
"selfLink": "",
"serviceAccountEmail": "",
"state": "",
"timeCreated": "",
"updated": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accessId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectId' => '',
'selfLink' => '',
'serviceAccountEmail' => '',
'state' => '',
'timeCreated' => '',
'updated' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accessId' => '',
'etag' => '',
'id' => '',
'kind' => '',
'projectId' => '',
'selfLink' => '',
'serviceAccountEmail' => '',
'state' => '',
'timeCreated' => '',
'updated' => ''
]));
$request->setRequestUrl('{{baseUrl}}/projects/:projectId/hmacKeys/:accessId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accessId": "",
"etag": "",
"id": "",
"kind": "",
"projectId": "",
"selfLink": "",
"serviceAccountEmail": "",
"state": "",
"timeCreated": "",
"updated": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/projects/:projectId/hmacKeys/:accessId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accessId": "",
"etag": "",
"id": "",
"kind": "",
"projectId": "",
"selfLink": "",
"serviceAccountEmail": "",
"state": "",
"timeCreated": "",
"updated": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/projects/:projectId/hmacKeys/:accessId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
payload = {
"accessId": "",
"etag": "",
"id": "",
"kind": "",
"projectId": "",
"selfLink": "",
"serviceAccountEmail": "",
"state": "",
"timeCreated": "",
"updated": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId"
payload <- "{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/projects/:projectId/hmacKeys/:accessId') do |req|
req.body = "{\n \"accessId\": \"\",\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"projectId\": \"\",\n \"selfLink\": \"\",\n \"serviceAccountEmail\": \"\",\n \"state\": \"\",\n \"timeCreated\": \"\",\n \"updated\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId";
let payload = json!({
"accessId": "",
"etag": "",
"id": "",
"kind": "",
"projectId": "",
"selfLink": "",
"serviceAccountEmail": "",
"state": "",
"timeCreated": "",
"updated": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/projects/:projectId/hmacKeys/:accessId \
--header 'content-type: application/json' \
--data '{
"accessId": "",
"etag": "",
"id": "",
"kind": "",
"projectId": "",
"selfLink": "",
"serviceAccountEmail": "",
"state": "",
"timeCreated": "",
"updated": ""
}'
echo '{
"accessId": "",
"etag": "",
"id": "",
"kind": "",
"projectId": "",
"selfLink": "",
"serviceAccountEmail": "",
"state": "",
"timeCreated": "",
"updated": ""
}' | \
http PUT {{baseUrl}}/projects/:projectId/hmacKeys/:accessId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "accessId": "",\n "etag": "",\n "id": "",\n "kind": "",\n "projectId": "",\n "selfLink": "",\n "serviceAccountEmail": "",\n "state": "",\n "timeCreated": "",\n "updated": ""\n}' \
--output-document \
- {{baseUrl}}/projects/:projectId/hmacKeys/:accessId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accessId": "",
"etag": "",
"id": "",
"kind": "",
"projectId": "",
"selfLink": "",
"serviceAccountEmail": "",
"state": "",
"timeCreated": "",
"updated": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/projects/:projectId/hmacKeys/:accessId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
storage.projects.serviceAccount.get
{{baseUrl}}/projects/:projectId/serviceAccount
QUERY PARAMS
projectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/projects/:projectId/serviceAccount");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/projects/:projectId/serviceAccount")
require "http/client"
url = "{{baseUrl}}/projects/:projectId/serviceAccount"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/projects/:projectId/serviceAccount"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/projects/:projectId/serviceAccount");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/projects/:projectId/serviceAccount"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/projects/:projectId/serviceAccount HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/projects/:projectId/serviceAccount")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/projects/:projectId/serviceAccount"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/projects/:projectId/serviceAccount")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/projects/:projectId/serviceAccount")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/projects/:projectId/serviceAccount');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/projects/:projectId/serviceAccount'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/projects/:projectId/serviceAccount';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/projects/:projectId/serviceAccount',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/projects/:projectId/serviceAccount")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/projects/:projectId/serviceAccount',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/projects/:projectId/serviceAccount'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/projects/:projectId/serviceAccount');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/projects/:projectId/serviceAccount'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/projects/:projectId/serviceAccount';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/projects/:projectId/serviceAccount"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/projects/:projectId/serviceAccount" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/projects/:projectId/serviceAccount",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/projects/:projectId/serviceAccount');
echo $response->getBody();
setUrl('{{baseUrl}}/projects/:projectId/serviceAccount');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/projects/:projectId/serviceAccount');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/projects/:projectId/serviceAccount' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/projects/:projectId/serviceAccount' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/projects/:projectId/serviceAccount")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/projects/:projectId/serviceAccount"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/projects/:projectId/serviceAccount"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/projects/:projectId/serviceAccount")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/projects/:projectId/serviceAccount') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/projects/:projectId/serviceAccount";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/projects/:projectId/serviceAccount
http GET {{baseUrl}}/projects/:projectId/serviceAccount
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/projects/:projectId/serviceAccount
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/projects/:projectId/serviceAccount")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()