我正在使用Gmail API,它允许我获取多个Gmail对象的批处理响应。这以multipart/mixed HTTP响应的形式返回,并在标头中定义了一组分隔的单独HTTP响应边界。每个HTTP子响应都是JSON格式的。例如:
有没有库或简单的方法可以将这些响应从字符串转换为独立的HTTP响应或JSON对象?
result.response.response_headers = {...
"content-type"=>"multipart/mixed; boundary=batch_abcdefg"...
}
result.response.body = "----batch_abcdefg
<the response header>
{some JSON}
--batch_abcdefg
<another response header>
{some JSON}
--batch_abcdefg--"
有没有库或简单的方法可以将这些响应从字符串转换为独立的HTTP响应或JSON对象?