이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
matlab.net.http.ResponseMessage 클래스
네임스페이스: matlab.net.http
슈퍼클래스: matlab.net.http.Message
HTTP 응답 메시지
설명
ResponseMessage
클래스는 서버에서 반환되는 HTTP 응답 메시지의 형식을 지정합니다.
생성
RequestMessage.send
메서드는 응답 메시지를 생성합니다.
속성
StatusLine
— 서버에서 반환되는 상태 라인
StatusLine
객체
서버에서 반환되는 상태 라인으로, matlab.net.http.StatusLine
객체로 지정됩니다.
특성:
GetAccess | public |
SetAccess | public |
Dependent | true |
StatusCode
— HTTP 상태 코드
StatusCode
객체
HTTP 상태 코드로, matlab.net.http.StatusCode
객체로 지정됩니다. StatusLine.StatusCode
속성과 동일합니다.
특성:
GetAccess | public |
SetAccess | immutable |
Dependent | true |
Header
— 메시지 헤더
[]
(디폴트 값) | matlab.net.http.HeaderField
객체
메시지 헤더로, matlab.net.http.HeaderField
객체로 지정되거나 HeaderField
객체의 벡터로 지정됩니다. Header
속성을 설정하면 MATLAB®이 헤더 필드가 메시지 유형에 적합한지 확인합니다. RequestMessage
의 send
메서드와 complete
메서드가 적절하게 구성된 요청에 필요한 모든 헤더 필드를 채웁니다.
특성:
GetAccess | public |
SetAccess | public |
Body
— 메시지 본문
[]
(디폴트 값) | matlab.net.http.MessageBody
객체 | matlab.net.http.io.ContentProvider
메시지 본문으로, matlab.net.http.MessageBody
객체, matlab.net.http.io.ContentProvider
또는 MessageBody
생성자에 허용되는 데이터로 지정됩니다. 기본적으로 Body
는 비어 있습니다([]
로 설정됨). Body
속성을 포함하는 요청 메시지는 일반적으로 디폴트 값 'GET'
이 아닌 'PUT'
또는 'POST'
와 같은 메서드를 사용하지만, 이 규칙이 강제적인 것은 아닙니다.
완료되었거나 수신된 메시지에 ContentTypeField
헤더 필드가 있는 경우 MessageBody.ContentType
속성이 해당 값으로 설정됩니다. 그렇지 않으면, ContentType
이 변경되지 않거나 비어 있습니다.
특성:
GetAccess | public |
SetAccess | public |
Completed
— 메시지 완료 여부
false
(디폴트 값) | true
메시지 완료 여부로, true
또는 false
로 지정됩니다. true
값은 메시지가 완료되었음을 의미합니다. 메시지를 반환하는 메서드는 다음과 같은 경우 Completed
속성을 true
로 설정합니다.
Body
속성이나Body.Data
속성이 비어 있습니다.Body.Payload
속성에 원시 데이터가 포함되어 있습니다.
특성:
GetAccess | public |
SetAccess | public |
Transient | true |
데이터형: logical
메서드
퍼블릭 메서드
complete | 응답 페이로드 Content-Type 처리 또는 재처리 |
addFields | 메시지 헤더에 필드 추가 |
changeFields | 메시지 헤더의 기존 필드 변경 |
getFields | 이름이나 클래스가 일치하는 메시지 헤더 필드 반환 |
removeFields | 메시지 헤더에서 필드 제거 |
replaceFields | Change values in or add fields to message header |
show | 메시지를 서식 지정하여 표시 또는 반환 |
특화된 연산자와 함수
다음 메서드는 표준 MATLAB 연산자와 함수를 이 클래스의 객체를 위해 특화합니다.
string | 메시지
문자열은 전송되거나 수신되었을 때 메시지가 어떻게 표시되는지에 대한 대략적인 표현입니다. 로깅, 진단 또는 디버그를 위해 사용하십시오. 메시지의 서식이 지정된 버전이 필요한 경우 |
char |
|
isequal | 두 메시지 배열의 모든 메시지의 가시적 퍼블릭 속성이 동일하면 |
예제
웹 사이트에서 이미지 요청하기
목성 이미지를 요청하는 메시지를 Hubble Heritage 웹 사이트로 보냅니다.
HTTP 요청 메시지의 형식을 지정하고 응답 메시지 본문의 Content-Type을 표시합니다. 서버가 JPEG 이미지를 반환합니다.
request = matlab.net.http.RequestMessage;
uri = matlab.net.URI('http://heritage.stsci.edu/2007/14/images/p0714aa.jpg');
r = send(request,uri);
r.Body.ContentType
ans = MediaType with properties: Type: "image" Subtype: "jpeg" Parameters: [] MediaInfo: "image/jpeg" Weight: []
imshow
함수를 사용하여 이미지를 표시합니다. MATLAB이 화면에 맞게 이미지 크기를 조정합니다.
warning('off','Images:initSize:adjustingMag'); imshow(r.Body.Data)
버전 내역
R2016b에 개발됨
참고 항목
RequestMessage
| send
| StatusLine
| StatusCode
| MessageBody
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)