Content length records the length of the associated content. The value -1 indicates that the length is unknown. Unless http method is "HEAD", values >= 0 indicate that the given number of bytes may be read from Body.
Content length records the length of the associated content. The
value -1 indicates that the length is unknown. Unless http method
is "HEAD", values >= 0 indicate that the given number of bytes may
be read from Body.
Returns
Type
Description
int|string
setContentLength
Content length records the length of the associated content. The
value -1 indicates that the length is unknown. Unless http method
is "HEAD", values >= 0 indicate that the given number of bytes may
be read from Body.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Apigee Connect V1 Client - Class HttpResponse (2.0.5)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.5 (latest)](/php/docs/reference/cloud-apigee-connect/latest/V1.HttpResponse)\n- [2.0.4](/php/docs/reference/cloud-apigee-connect/2.0.4/V1.HttpResponse)\n- [1.2.5](/php/docs/reference/cloud-apigee-connect/1.2.5/V1.HttpResponse)\n- [1.1.3](/php/docs/reference/cloud-apigee-connect/1.1.3/V1.HttpResponse)\n- [1.0.5](/php/docs/reference/cloud-apigee-connect/1.0.5/V1.HttpResponse) \nReference documentation and code samples for the Google Cloud Apigee Connect V1 Client class HttpResponse.\n\nThe proto definition of http response.\n\nGenerated from protobuf message `google.cloud.apigeeconnect.v1.HttpResponse`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ ApigeeConnect \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getId\n\nA unique identifier that matches the request ID.\n\n### setId\n\nA unique identifier that matches the request ID.\n\n### getStatus\n\nStatus of http response, e.g. \"200 OK\".\n\n### setStatus\n\nStatus of http response, e.g. \"200 OK\".\n\n### getStatusCode\n\nStatus code of http response, e.g. 200.\n\n### setStatusCode\n\nStatus code of http response, e.g. 200.\n\n### getBody\n\nThe HTTP 1.1 response body.\n\n### setBody\n\nThe HTTP 1.1 response body.\n\n### getHeaders\n\nThe HTTP response headers.\n\n### setHeaders\n\nThe HTTP response headers.\n\n### getContentLength\n\nContent length records the length of the associated content. The\nvalue -1 indicates that the length is unknown. Unless http method\nis \"HEAD\", values \\\u003e= 0 indicate that the given number of bytes may\nbe read from Body.\n\n### setContentLength\n\nContent length records the length of the associated content. The\nvalue -1 indicates that the length is unknown. Unless http method\nis \"HEAD\", values \\\u003e= 0 indicate that the given number of bytes may\nbe read from Body."]]