Skip to main content

Class: Http

google.api.Http

Defines the HTTP configuration for an API service. It contains a list of [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method to one or more HTTP REST API methods.

Implements

Constructors

constructor

new Http(properties?): Http

Constructs a new Http.

Parameters

NameTypeDescription
properties?IHttpProperties to set

Returns

Http

Properties

fullyDecodeReservedExpansion

fullyDecodeReservedExpansion: boolean

When set to true, URL path parameters will be fully URI-decoded except in cases of single segment matches in reserved expansion, where "%2F" will be left encoded.

The default behavior is to not decode RFC 6570 reserved characters in multi segment matches.

Implementation of

IHttp.fullyDecodeReservedExpansion


rules

rules: IHttpRule[]

A list of HTTP configuration rules that apply to individual API methods.

NOTE: All service configuration rules follow "last one wins" order.

Implementation of

IHttp.rules

Methods

toJSON

toJSON(): Object

Converts this Http to JSON.

Returns

Object

JSON object


create

create(properties?): Http

Creates a new Http instance using the specified properties.

Parameters

NameTypeDescription
properties?IHttpProperties to set

Returns

Http

Http instance


decode

decode(reader, length?): Http

Decodes a Http message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

Http

Http

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): Http

Decodes a Http message from the specified reader or buffer, length delimited.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Http

Http

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode

encode(message, writer?): Writer

Encodes the specified Http message. Does not implicitly google.api.Http.verify|verify messages.

Parameters

NameTypeDescription
messageIHttpHttp message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified Http message, length delimited. Does not implicitly google.api.Http.verify|verify messages.

Parameters

NameTypeDescription
messageIHttpHttp message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): Http

Creates a Http message from a plain object. Also converts values to their respective internal types.

Parameters

NameTypeDescription
objectObjectPlain object

Returns

Http

Http


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Http

Parameters

NameTypeDescription
typeUrlPrefix?stringyour custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


toObject

toObject(message, options?): Object

Creates a plain object from a Http message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageHttpHttp
options?IConversionOptionsConversion options

Returns

Object

Plain object