当我尝试public static string ToBson<T>(T value)
{
using (MemoryStream ms = new MemoryStream())
using (BsonDataWriter datawriter = new BsonDataWriter(ms))
{
JsonSerializer serializer = new JsonSerializer();
serializer.Serialize(datawriter, value);
return Convert.ToBase64String(ms.ToArray());
}
}
public static T FromBson<T>(string base64data)
{
byte[] data = Convert.FromBase64String(base64data);
using (MemoryStream ms = new MemoryStream(data))
using (BsonDataReader reader = new BsonDataReader(ms))
{
JsonSerializer serializer = new JsonSerializer();
return serializer.Deserialize<T>(reader);
}
}
或GET
时,它会以POST
有人能告诉我问题在哪里吗?
答案 0 :(得分:1)
你可以尝试使用Postman Interceptor解决这个问题。
默认情况下,Chrome应用无法发送某些标头(主机是其中之一) 他们在XHR请求中。
https://www.getpostman.com/docs/postman/sending_api_requests/interceptor_extension