def parse_http_response (response):
    """
    Parse the response from a REST request to determine the request status code and get the response
    data.
    
    :param response: The response received from the request.
    
    :return A tuple containing the response status code and body.
    """
    
    line_start = 0
    while (True):
        line_end = response.index ("\r\n", line_start)
        status_line = response[:line_end].split ()
        status_code = int (status_line[1])
        if (status_code >= 200):
            break;
        
        line_start = response.index ("\r\n\r\n", line_start) + 4
        
    body = response.index ("\r\n\r\n", line_start) + 4
    return (status_code, response[body:])