抓取http协议分析了之后,发现这个特殊post没有像一般的post那个的参数对,而是这样的,请各位看图片,

解决方案 »

  1.   

    我这样写,不行啊。。nvps.add(new BasicNameValuePair("(Content)", (。。}));
      

  2.   

    所提交内容是JSON串,但可能没有命名。别直接看POST Data页面,去看看Stream页面的左侧,这里的信息更为原始真实,辛苦楼主贴出来看看。
      

  3.   

    POST /jwxt/xscjcxAction/xscjcxAction.action?method=getKccjList HTTP/1.1
    Accept: */*
    Accept-Language: zh-cn
    ajaxrequest: true
    __clienttype: unieap
    resourceid: null
    Content-Type: multipart/form-data
    workitemid: null
    Referer: http:///jwxt/forward.action?path=//xscj/xscjcx/xsgrcj_list
    render: unieap
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
    Host: 
    Content-Length: 827
    Connection: Keep-Alive
    Cache-Control: no-cache
    Cookie: JSESSIONID=A7FEDF34AA0592503FDEBB10B1801CD1{header:{"code": -100, "message": {"title": "", "detail": ""}},body:{dataStores:{kccjStore:{rowSet:{"primary":[],"filter":[],"delete":[]},name:"kccjStore",pageNumber:1,pageSize:10,recordCount:11,rowSetName:"pojo_com.neusoft.education.sysu.xscj.xscjcx.model.KccjModel",order:"t.xn, t.xq, t.kch, t.bzw"}},parameters:{"kccjStore-params": [{"name": "Filter_t.pylbm_0.5561039376138874", "type": "String", "value": "'01'", "condition": " = ", "property": "t.pylbm"}, {"name": "Filter_t.xn_0.10712511051512274", "type": "String", "value": "'2010-2011'", "condition": " = ", "property": "t.xn"}, {"name": "Filter_t.xq_0.40865586464372716", "type": "String", "value": "'1'", "condition": " = ", "property": "t.xq"}, {"name": "xh", "type": "String", "value": "''", "condition": " = ", "property": "t.xh"}], "args": ["student"]}}}
      

  4.   

    没什么特殊啊,人家传的是json
    写的时候直接写流,而不是写键值对
      

  5.   

    哦,这种情况,直接把整个JSON作为发送内容提交出去就行了,不要加什么BasicNameValuePair。
      

  6.   


    免得你到处找了:
    httppost.setEntity(new StringEntity("你构造的JSON字符串"));
      

  7.   

    3Q,我刚想问你httpost.setEntity();这个东西着呢吗搞,呵呵,多谢了。
      

  8.   

    HttpPost httpost = new HttpPost(url);
    String a = "字符串";
    try {
    httpost.setEntity(new StringEntity(a));
    response = httpclient.execute(httpost);
    }是不是大题是这样?
      

  9.   

    是的,如果再出问题,就继续检查其它的参数头信息,比如:ajaxrequest: true
    __clienttype: unieap
    resourceid: null
    Content-Type: multipart/form-data
    workitemid: null因为不知道对方会检查啥,所以看到长相奇特的都要引起注意。