title: Jsoup returns Status 400
body: <p>I want to crawl data from this URL : <a href="http://www.expedia.co.jp/Osaka-Hotels-Hotel-Consort.h5522663.Hotel-Information?chkin=2017/12/13&amp;chkout=2017/12/14&amp;rm1=a2" rel="nofollow noreferrer">http://www.expedia.co.jp/Osaka-Hotels-Hotel-Consort.h5522663.Hotel-Information?chkin=2017/12/13&amp;chkout=2017/12/14&amp;rm1=a2
  </a></p>
  
  <p>So I have written following code </p>
  
  <pre><code>import java.io.IOException;
  import org.jsoup.Jsoup;
  import org.jsoup.nodes.Document;
  import static org.jsoup.Connection.*;
  
  /**
   * Created by avi on 11/24/17.
   */
  public class ExpediaCurl {
  
      public static void main(String[] args) {
          final String USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36";
  
  
          Response res = null;
          try {
              res = Jsoup.connect("http://www.expedia.co.jp/Osaka-Hotels-Hotel-Consort.h5522663.Hotel-Information?")
                      .data("adults", "2", "children", "0",  "chkin", "2017/12/13", "chkout", "2017/12/14")
                      .method(Method.POST)
                      .execute();
  
              Document doc = res.parse();
              Map&lt;String,String&gt; cookies = res.cookies();
              System.out.println(cookies.toString());
              Document doc2 = Jsoup.connect("https://www.expedia.co.jp/infosite-api/5522663/getOffers?clientid=KLOUD-HIWPROXY&amp;token=bc9e0d07b9dcc14506a3ce5587703329a02e9f9e&amp;brandId=0&amp;countryId=0&amp;isVip=false&amp;chid=&amp;partnerName=&amp;partnerPrice=0&amp;partnerCurrency=&amp;partnerTimestamp=0&amp;adults=2&amp;children=0&amp;chkin=2017%2F12%2F13&amp;chkout=2017%2F12%2F14&amp;swpToggleOn=false&amp;daysInFuture=&amp;stayLength=&amp;ts=1513141494203&amp;evalMODExp=true&amp;tla=OSA")
                      .cookies(cookies) // &lt;-- I believe This cookie is not working
                      .userAgent(USER_AGENT)
                      .get();
              System.out.printf(doc2.html());
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>I am getting following error</p>
  
  <pre><code>org.jsoup.HttpStatusException: HTTP error fetching URL. Status=400, URL=https://www.expedia.co.jp/infosite-api/5522663/getOffers?clientid=KLOUD-HIWPROXY&amp;token=bc9e0d07b9dcc14506a3ce5587703329a02e9f9e&amp;brandId=0&amp;countryId=0&amp;isVip=false&amp;chid=&amp;partnerName=&amp;partnerPrice=0&amp;partnerCurrency=&amp;partnerTimestamp=0&amp;adults=2&amp;children=0&amp;chkin=2017%252F12%252F13&amp;chkout=2017%252F12%252F14&amp;swpToggleOn=false&amp;daysInFuture=&amp;stayLength=&amp;ts=1513141494203&amp;evalMODExp=true&amp;tla=OSA
      at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:679)
      at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:628)
      at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:260)
      at org.jsoup.helper.HttpConnection.get(HttpConnection.java:249)
      at ExpediaCurl.main(ExpediaCurl.java:31)
  </code></pre>
  
  <p>Can someone Help me out that what is wrong I am doing. </p>