Sends an HTTP PUT
request to the specified URL.
For more information, see Make an HTTP request .
Arguments
url
string
The URL to send the request to.
timeout
float
The request timeout, in seconds (default: 300.0
). If the request takes longer than the timeout, a TimeoutError
is raised. The maximum allowed timeout is 1800
seconds.
body
Content-Type
header is not specified and if the body value is bytes, the header is set to Content-Type: application/octet-stream
; otherwise, the body is JSON-encoded and the header is set to Content-type: application/json; charset=utf-8
.headers
Content-Type
header is specified, the request body is encoded as prescribed. For example, it might be JSON or URL-encoded.query
auth
type
attribute in ["OIDC", "OAuth2"]
. A scopes
key is also supported. For details, see Make authenticated requests to Google Cloud APIs
.private_service_name
string
If present, private_service_name
must be a string that specifies a registered Service Directory service name with format projects/my-project/locations/us-east1/namespaces/
my-namespace/services/my-service
.
ca_certificate
bytes
If present, ca_certificate
must be a bytes value describing a custom CA certificate in DER format that will be used in place of the standard certificate pool. The certificate must be signed by a subject alternative name as defined by RFC 3280
.
Returns
The HTTP response as a map with body
, code
(status code), and headers
attributes.
Raised exceptions
ConnectionError
ConnectionFailedError
TimeoutError
HttpError
ValueError
Examples
# Make a `PUT` request to an external HTTP endpoint - send_message : call : http.put args : url : https://www.example.com/endpoint body : some_val : "Hello World" another_val : 123 result : the_message - return_value : return : ${the_message.body}

