이 객체를 가지고 있으며 customer_email 값을 기준으로 필터링하려고합니다. 예를 들어 고객 전자 메일이 [email protected] 인 커미션 만 반환하려고합니다. 이것은 응답이 어떻게 생겼는지에 대한 간단한 예입니다. 아래는 모든 데이터를 가져 오는 방법입니다. 나는 응답을받을 때값을 기준으로 JSON 필터링
public RootObject GetData(string customerEmail)
{
var data = new Commission();
using (var httpClient = new HttpClient())
{
var requestContent = JObject.FromObject(new
{
commission_id = data.id,
customer_email = customerEmail
}).ToString();
......
RootObject response = JsonConvert.DeserializeObject<RootObject>(responseContent);
return response;
}
}
는 정보는 다음과 같습니다
{"response":{
"code":"200",
"message":"OK: The request was successful. See response body for additional data.",
"data":{
"commissions":
[{
"commission_id":"12345",
"customer_email":"[email protected]"
},
{
"commission_id":"67890",
"customer_email":"[email protected]"
}]
RootObject 클래스의 코드를 게시 할 수 있습니까? – Richard