httpclient post

本文介绍了如何使用 C# 的 HttpClient 进行API请求,包括构造DocQueryParam对象,设置过滤条件、分页参数,并展示了如何序列化和解析JSON响应。重点在于使用PageInfo和FilterData类来处理查询结果的分页和筛选。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace HttpClientQuery
{
class PageInfo
{
public int start; //得是public类型

public string table;

public int getStart(){
return start;
}

//不能用c#自带的get set方法 以下get set方法是在sts中建相应的java类后用自动生成方法得到的
public void setStart(int start){
this.start = start;
}

public string getTable(){
return table;
}

public void setTable(string table){
this.table = table;
}

public PageInfo(){
}

public PageInfo(int start, string table){
this.start = start;
this.table = table;
}
}

class FilterData
{
public string name;

public string value;

public string getName(){
return name;
}

public void setName(string name){
this.name = name;
}

public string getValue(){
return value;
}

public void setValue(string value){
this.value = value;
}

public FilterData()
{
}

public FilterData(string name, string value)
{
this.name = name;
this.value = value;
}
}

class DocQueryParam
{
public string id;

public List<FilterData> filterData;

public List<PageInfo> paginationInfo;

public int searchType;

public string tablename;


public string getId(){
return id;
}

public void setId(string id){

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值