%% How to Choose a Status Code Conversion Method
% The StatusCode methods - char, string, getReasonPhrase, and getClass - provide information about the code and its meaning. Choose a method based on your requirements.
% Suppose that your response message contains status code 307. To run this example, create the code.

sc = matlab.net.http.StatusCode(307);

%
% Use the char and the getReasonPhrase methods to return text for the status code meaning. The getReasonPhrase method creates a phrase you can use in messages.

txt = char(sc)
msg = getReasonPhrase(sc)

%
% Use the string method to return the integer value of the status code as a string.

value = string(sc)

%
% If your code processes status codes based on status class, use the getClass method.

class = getClass(sc)

% Copyright 2012 The MathWorks, Inc.