Unity Web Request Creating Upload Handlers
Send request body data to a server using the UploadHandlerRaw and UploadHandlerFile upload handlers.
읽는 시간 1분최근 업데이트: 한 달 전
현재 사용 가능한 업로드 핸들러 유형은 및 의 두 가지입니다.
UploadHandlerRawUploadHandlerFileUploadHandlerRawUnityWebRequestNativeArrayUploadHandlerFile업로드 핸들러도 Content Type 문자열을 허용합니다. 이 문자열은 UnityWebRequest 자체에 헤더를 설정하지 않은 경우 UnityWebRequest의 헤더 값에 사용됩니다. UnityWebRequest 오브젝트에서 수동으로 헤더를 설정하면 Upload Handler 오브젝트의 이 무시됩니다.
Content-TypeContent-TypeContent-TypeContent-TypeUnityWebRequest나 에서 을 설정하지 않으면 시스템은 기본적으로 의 을 설정합니다.
UploadHandlerContent-Typeapplication/octet-streamContent-TypeUnityWebRequestdisposeUploadHandlerOnDispose예제
byte[] payload = new byte[1024];// ... fill payload with data ...UnityWebRequest wr = new UnityWebRequest("https://www.mysite.com/data-upload");UploadHandler uploader = new UploadHandlerRaw(payload);// Sends header: "Content-Type: custom/content-type";uploader.contentType = "custom/content-type";wr.uploadHandler = uploader;