Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
ID da região
O REGION_ID é um código abreviado que o Google atribui
com base na região que você selecionou ao criar o aplicativo. O código não
corresponde a um país ou estado, ainda que alguns IDs de região sejam semelhantes
aos códigos de país e estado geralmente usados. Para apps criados após
fevereiro de 2020, o REGION_ID.r está incluído nos
URLs do App Engine. Para apps existentes criados antes dessa data, o
ID da região é opcional no URL.
Use esta página de referência para consultar detalhes sobre os cabeçalhos HTTP compatíveis. Para entender como o App Engine recebe solicitações e envia respostas, consulte Como as solicitações são processadas.
Cabeçalhos de solicitação
Uma solicitação HTTP recebida inclui os cabeçalhos HTTP enviados pelo cliente. Para
fins de segurança, alguns cabeçalhos são limpos, alterados ou removidos por
proxies intermediários antes de chegar ao app.
Cabeçalhos removidos de solicitações recebidas
Os seguintes cabeçalhos são removidos das solicitações recebidas se um cliente as enviar:
Cabeçalhos com nomes que correspondem ao padrão X-Google-*. Esse padrão de nome
é reservado para o Google.
Cabeçalhos com nomes que correspondem
a cabeçalhos específicos do App Engine. Somente
correspondências exatas e indiferentes a maiúsculas são removidas. Por exemplo, os cabeçalhos chamados
X-Appengine-Country ou X-AppEngine-Country serão removidos, mas
X-Appengine-Cntry, não.
Cabeçalhos específicos do App Engine
Como um serviço ao aplicativo, o App Engine adiciona estes cabeçalhos a todas as solicitações:
X-Appengine-Country
País de origem da solicitação, como um código do país ISO 3166-1
alfa-2.
O App Engine determina esse código com base no endereço IP do cliente. Observe que
as informações do país não são derivadas do banco de dados WHOIS. É possível que
um endereço IP com informações de país no banco de dados WHOIS não tenha informações
de país no cabeçalho X-Appengine-Country. O app precisa
processar o código especial de país ZZ (país desconhecido).
X-Appengine-Region
Nome da região de origem da solicitação. Esse valor só faz
sentido no contexto do país em X -Appengine-Country. Por exemplo, se
o país é "US" e a região é "ca", esse "ca" significa "Califórnia", e não
Canadá. É possível encontrar a lista completa de valores regionais válidos no padrão ISO-3166-2.
X-Appengine-City
Nome da cidade de origem da solicitação. Por exemplo, uma solicitação
da cidade de Mountain View pode ter o valor de cabeçalho mountain view.
Não há uma lista canônica de valores válidos para esse cabeçalho. Se não for possível resolver a cidade, o valor do cabeçalho será definido como ?.
X-Appengine-CityLatLong
Latitude e longitude da cidade de origem da solicitação. Essa string pode ser "37.386051, -122.083851" para uma solicitação de Mountain View.
Se não for possível resolver a cidade, o valor do cabeçalho será definido como 0.000000,0.000000.
X-Cloud-Trace-Context
Um identificador exclusivo da solicitação usada para o Cloud Trace
e o Cloud Logging. Não há a opção de desativar esse cabeçalho
ou escolher a taxa de amostragem para rastreamento, porque todos os aplicativos do ambiente padrão do App Engine são rastreados
automaticamente.
Uma lista delimitada por vírgulas de endereços IP por meio dos quais a solicitação do cliente foi roteada. O primeiro IP da lista geralmente é o IP do cliente que
criou a solicitação. Os IPs subsequentes fornecem informações sobre servidores proxy
que também processaram a solicitação antes de ela chegar ao servidor do app. Exemplo:
X-Forwarded-For: clientIp, proxy1Ip, proxy2Ip
X-Forwarded-Proto [http | https]
Mostra http ou https com base no protocolo que o cliente usou para se conectar
ao app.
O balanceador de carga do Google Cloud encerra todas as conexões de https e, em seguida,
encaminha o tráfego para as instâncias do App Engine em http. Por exemplo, se um usuário
solicitar acesso ao site por meio de
https://PROJECT_ID.REGION_ID.r.appspot.com, o valor do cabeçalho X-
Forwarded-Proto será https.
Além disso, o App Engine pode definir os seguintes cabeçalhos para
uso interno:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-19 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eREGION_ID\u003c/code\u003e is a code assigned by Google based on the selected region when creating an app, and it is included in App Engine URLs for apps created after February 2020.\u003c/p\u003e\n"],["\u003cp\u003eFor security, certain HTTP headers sent by clients are removed from incoming requests, specifically those matching the \u003ccode\u003eX-Google-*\u003c/code\u003e pattern and exact matches of App Engine-specific header names like \u003ccode\u003eX-Appengine-Country\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine adds several specific headers to all requests, including \u003ccode\u003eX-Appengine-Country\u003c/code\u003e, \u003ccode\u003eX-Appengine-Region\u003c/code\u003e, \u003ccode\u003eX-Appengine-City\u003c/code\u003e, and \u003ccode\u003eX-Appengine-CityLatLong\u003c/code\u003e, which provide information about the request's origin.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eX-Forwarded-For\u003c/code\u003e header provides a comma-delimited list of IP addresses that the client request has been routed through, and \u003ccode\u003eX-Forwarded-Proto\u003c/code\u003e indicates the protocol used by the client to connect.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine also sets headers, for internal use, such as \u003ccode\u003eX-Appengine-Https\u003c/code\u003e, \u003ccode\u003eX-Appengine-User-IP\u003c/code\u003e, \u003ccode\u003eX-Appengine-Api-Ticket\u003c/code\u003e, \u003ccode\u003eX-Appengine-Request-Log-Id\u003c/code\u003e, \u003ccode\u003eX-Appengine-Default-Version-Hostname\u003c/code\u003e, and \u003ccode\u003eX-Appengine-Timeout-Ms\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Request headers\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Region ID\n\nThe \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e is an abbreviated code that Google assigns\nbased on the region you select when you create your app. The code does not\ncorrespond to a country or province, even though some region IDs may appear\nsimilar to commonly used country and province codes. For apps created after\nFebruary 2020, \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e`.r` is included in\nApp Engine URLs. For existing apps created before this date, the\nregion ID is optional in the URL.\n\nLearn more\n[about region IDs](/appengine/docs/flexible/python/how-requests-are-routed#region-id). \nOK\n\nUse this reference page for details about what HTTP headers are supported\n. To understand how App Engine receives\nrequests and sends responses, see [How Requests Are\nHandled](/appengine/docs/flexible/how-requests-are-handled).\n\nRequest headers\n---------------\n\nAn incoming HTTP request includes the HTTP headers sent by the client. For\nsecurity purposes, some headers are sanitized, amended, or removed by\nintermediate proxies before they reach the application.\n\n### Headers removed from incoming requests\n\nThe following headers are removed from incoming requests if a client sends them:\n\n- Headers with names that match the `X-Google-*` pattern. This name pattern\n is reserved for Google.\n\n- Headers with names that match\n [App Engine-specific headers](#app_engine-specific_headers). Only\n exact, case-insensitive matches are removed. For example, headers named\n `X-Appengine-Country` or `X-AppEngine-Country` will be removed but\n `X-Appengine-Cntry` will not.\n\n### App Engine-specific headers\n\nAs a service to the app, App Engine adds the following headers to all requests:\n\n`X-Appengine-Country`\n: Country from which the request originated, as an [ISO 3166-1\n alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.\n App Engine determines this code from the client's IP address. Note that\n the country information is not derived from the WHOIS database; it's possible\n that an IP address with country information in the WHOIS database will not have\n country information in the `X-Appengine-Country` header. Your application should\n handle the special country code `ZZ` (unknown country).\n\n`X-Appengine-Region`\n: Name of region from which the request originated. This value only makes\n sense in the context of the country in `X -Appengine-Country`. For example, if\n the country is \"US\" and the region is \"ca\", that \"ca\" means \"California\", not\n Canada. The complete list of valid region values is found in the\n [ISO-3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) standard.\n\n`X-Appengine-City`\n: Name of the city from which the request originated. For example, a request\n from the city of Mountain View might have the header value `mountain view`.\n There is no canonical list of valid values for this header. If the city can't\n be resolved, the header value is set to `?`.\n\n`X-Appengine-CityLatLong`\n: Latitude and longitude of the city from which the request originated. This\n string might look like \"37.386051,-122.083851\" for a request from Mountain View.\n If the city can't be resolved, the header value is set to `0.000000,0.000000`.\n\n`X-Cloud-Trace-Context`\n: A unique identifier for the request used for [Cloud Trace](/trace)\n and [Cloud Logging](/logging). There isn't an option to disable this header\n or choose the sampling rate for tracing since all App Engine standard environment apps are traced\n automatically.\n\n`X-Forwarded-For: [CLIENT_IP(s)], [global forwarding rule IP]`\n\n: A comma-delimited list of IP addresses through which the client request has\n been routed. The first IP in this list is generally the IP of the client that\n created the request. The subsequent IPs provide information about proxy servers\n that also handled the request before it reached the application server. For\n example:\n\n X-Forwarded-For: clientIp, proxy1Ip, proxy2Ip\n\n`X-Forwarded-Proto [http | https]`\n\n: Shows `http` or `https` based on the protocol the client used to connect to\n your application.\n\n The Google Cloud Load Balancer terminates all `https` connections, and then\n forwards traffic to App Engine instances over `http`. For example, if a user\n requests access to your site via\n `https://`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003e\u003ca href=\"#appengine-urls\" style=\"border-bottom: 1px dotted #999\" class=\"devsite-dialog-button\" data-modal-dialog-id=\"regional_url\" track-type=\"progressiveHelp\" track-name=\"modalHelp\" track-metadata-goal=\"regionalURL\"\u003eREGION_ID\u003c/a\u003e\u003c/var\u003e`.r.appspot.com`, the X-\n Forwarded-Proto header value is `https`.\n\nIn addition, App Engine may set the following headers which are for\ninternal use by App Engine:\n\n- `X-Appengine-Https`\n- `X-Appengine-User-IP`\n- `X-Appengine-Api-Ticket`\n- `X-Appengine-Request-Log-Id`\n- `X-Appengine-Default-Version-Hostname`\n- `X-Appengine-Timeout-Ms`\n\n\u003cbr /\u003e"]]