Main Content

matlab.net.http.field.LocationField 클래스

네임스페이스: matlab.net.http.field
슈퍼클래스: matlab.net.http.HeaderField, matlab.net.http.field.URIReferenceField

HTTP의 Location 헤더 필드

설명

LocationField 객체에는 메시지의 URI(Uniform Resource Identifier)가 포함됩니다. 서버는 Location 필드를 응답 메시지에 추가하여 메시지를 다른 URI로 리디렉션하도록 사용자에게 지시합니다. 이 필드의 의미는 응답의 상태 코드에 따라 달라집니다.

클래스 특성

Sealed
true

클래스 특성에 대한 자세한 내용은 클래스 특성 항목을 참조하십시오.

생성

설명

예제

obj = matlab.net.http.field.LocationField(value)Value 속성을 value로 설정하여 Location 헤더 필드를 생성합니다.

속성

모두 확장

헤더 필드 이름으로, 'Location'으로 지정됩니다.

특성:

GetAccess
public
SetAccess
public

URI로, matlab.net.URI 객체로 지정되거나 URI 생성자가 허용하는 문자열로 지정됩니다.

특성:

GetAccess
public
SetAccess
public
Dependent
true

메서드

모두 확장

예제

모두 축소

이 예제에서는 메시지 URI를 읽는 방법을 보여줍니다.

import matlab.net.*;
import matlab.net.http.*;
httpUrl = 'http://requestserver.mathworks.com';
uri = URI(strcat(httpUrl, '/movedPermanently'));
options = HTTPOptions('MaxRedirects', 0); % Disable redirects
req = RequestMessage('GET');
response = req.send(uri, options);
locationField = response.getFields("Location");
disp(locationField)
  LocationField with properties:

     Name: "Location"
    Value: "http://requestserver.mathworks.com/assets/computerVision.jpg"

버전 내역

R2016b에 개발됨