Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
ID regione
REGION_ID è un codice abbreviato assegnato da Google in base alla regione selezionata quando crei l'app. Il codice non corrisponde a un paese o a una provincia, anche se alcuni ID regione possono sembrare simili ai codici di paesi e province di uso comune. Per le app create dopo febbraio 2020, REGION_ID.r è incluso negli URL di App Engine. Per le app esistenti create prima di questa data, l'ID regione è facoltativo nell'URL.
Consulta questa pagina di riferimento per informazioni dettagliate sulle intestazioni HTTP supportate. Per capire come App Engine riceve le richieste e invia le risposte, consulta la sezione Come vengono gestite le richieste.
Intestazioni delle richieste
Una richiesta HTTP in arrivo include le intestazioni HTTP inviate dal client. Per motivi di sicurezza, alcune intestazioni vengono sottoposte a sanificazione, modificate o rimosse dai proxy intermedi prima di raggiungere l'applicazione.
Intestazioni rimosse dalle richieste in arrivo
Le seguenti intestazioni vengono rimosse dalle richieste in entrata se un client le invia:
Intestazioni con nomi corrispondenti al pattern X-Google-*. Questo pattern di nome è riservato a Google.
Intestazioni con nomi corrispondenti alle intestazioni specifiche di App Engine. Vengono rimosse solo le corrispondenze esatte senza distinzione tra maiuscole e minuscole. Ad esempio, le intestazioni denominate
X-Appengine-Country o X-AppEngine-Country verranno rimosse, ma
X-Appengine-Cntry no.
Intestazioni specifiche di App Engine
Come servizio per l'app, App Engine aggiunge le seguenti intestazioni a tutte le richieste:
X-Appengine-Country
Paese da cui ha avuto origine la richiesta, come codice paese ISO 3166-1 alpha-2.
App Engine determina questo codice dall'indirizzo IP del client. Tieni presente che
le informazioni sul paese non provengono dal database WHOIS. È possibile
che un indirizzo IP con informazioni sul paese nel database WHOIS non abbia
informazioni sul paese nell'intestazione X-Appengine-Country. L'applicazione deve gestire il codice paese speciale ZZ (paese sconosciuto).
X-Appengine-Region
Nome della regione da cui ha avuto origine la richiesta. Questo valore ha senso solo nel contesto del paese in X -Appengine-Country. Ad esempio, se il paese è "US" e la regione è "ca", "ca" significa "California", non Canada. L'elenco completo dei valori regione validi è disponibile nello standard ISO-3166-2.
X-Appengine-City
Nome della città da cui ha avuto origine la richiesta. Ad esempio, una richiesta proveniente dalla città di Mountain View potrebbe avere il valore dell'intestazione mountain view.
Non esiste un elenco canonico di valori validi per questa intestazione. Se la città non può essere risolta, il valore dell'intestazione viene impostato su ?.
X-Appengine-CityLatLong
Latitudine e longitudine della città da cui ha avuto origine la richiesta. Questa stringa potrebbe essere "37.386051,-122.083851" per una richiesta da Mountain View.
Se non è possibile risolvere la città, il valore dell'intestazione viene impostato su 0.000000,0.000000.
X-Cloud-Trace-Context
Un identificatore univoco per la richiesta utilizzata per Cloud Trace
e Cloud Logging. Non è possibile disattivare questo intestazione o scegliere la frequenza di campionamento per il monitoraggio, poiché tutte le app dell'ambiente standard di App Engine vengono monitorate automaticamente.
Un elenco separato da virgole di indirizzi IP attraverso i quali è stata indirizzata la richiesta del client. In genere, il primo IP in questo elenco è l'IP del client che ha creato la richiesta. Gli IP successivi forniscono informazioni sui server proxy
che hanno gestito la richiesta anche prima che raggiungesse il server dell'applicazione. Ad
esempio:
X-Forwarded-For: clientIp, proxy1Ip, proxy2Ip
X-Forwarded-Proto [http | https]
Mostra http o https in base al protocollo utilizzato dal client per connettersi alla tua applicazione.
Il bilanciatore del carico di Google Cloud termina tutte le connessioni https, quindi inoltra il traffico alle istanze App Engine tramite http. Ad esempio, se un utente richiede l'accesso al tuo sito tramite https://PROJECT_ID.REGION_ID.r.appspot.com, il valore dell'intestazione X-Forwarded-Proto è https.
Inoltre, App Engine potrebbe impostare le seguenti intestazioni per uso interno di App Engine:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 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"]]