Home  >  Q&A  >  body text

java - 当httpClient在不同环境访问同一个请求出现response不一致的解决思路

主要是求一个解决问题的思路

情况是这样的,我这边在本地用java的http client去执行一个post请求,返回的是302,但是当我部署到服务器上时,返回变成200了。

本地环境:jdk 1.8 tomcat 8
服务器:jdk 1.7 tomcat没去确认版本

想问下出现一样的代码,httpclient会因为jdk或者tomcat版本有差异吗。或者,这种情况可以用怎么样的思路去排查问题

大家讲道理大家讲道理2743 days ago570

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 10:53:08

    Is it related to IP?

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-18 10:53:08

    Obviously there are two states. If you can see the server source code, trace the source code to see if the 302 jump is due to logical judgment. There may be a problem with the request body or header of the post request. Of course It is also possible that the web side on the server has forwarded requests, so we can only rule them out one by one

    reply
    0
  • Cancelreply