Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

UnityWebRequest.url

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public var url: string;
public string url;

Descripción

Defines the target URL for the UnityWebRequest to communicate with.

This property cannot be set after calling Send.

If the UnityWebRequest encounters and follows redirects, this property will be updated with the URL to which the UnityWebRequest was redirected.

When inputting URLs, absolute URLs are preferred. However, if you input a partial URL, the system will follow these rules:

If the input URL starts with two slashes (//), then the input is assumed to be a domain and path intended for use over HTTP.

On non-WebGL platforms, the system will prepend http:. On WebGL, the system will inherit the scheme of the path by which the Unity WebGL application is being accessed.

Examples: If the WebGL app is being accessed via https, the system will prepend https:. If the WebGL app is being accessed via http, the system will prepend http:.

If the input URL starts with a single slash (/), then the system assumes the inout is a path relative to the current domain on which the Unity application is running. On non-WebGL platforms, the system will prepend http://localhost to the URL.

On WebGL, the system will prepend the scheme and host of the path by which the Unity WebGL application is being accessed. For example, if the Unity WebGL app is being accessed via http://unity3d.com/myapp, then the system will prepend http://unity3d.com to relative paths.

If neither of the above rules apply, the system validates your input string via the built-in System.Uri class. If this class throws a URIFormatException, the system attempts to append the input string to the absolute URL by which the Unity app is being accessed. (see above)

Any further exceptions will be re-thrown.