Getting the Body of a Message
Remember that the server, when sending a list of messages, does not send the message
bodies. We only get the body of a selected message when needed, and that’s where
getMessageBody() factors in:
public async getMessageBody(inID: string, inMailbox: String):
Promise {
const response: AxiosResponse = await axios.get(
`${config.serverAddress}/messages/${inMailbox}/${inID}`
);
return response.data;
}
We need the ID of the message and the path to the mailbox it’s in, but other than
that, it’s not substantially different from getting a list of mailboxes.
Do'stlaringiz bilan baham: |