Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
8 years ago

Rest Api Error 400

Hello, I'm using Aras Innovator 11.0 SP12 and i'm trying to get specific items using the rest API and the following request : localhost/.../Part eq '1' Tryning with postman, no problem, i retrieve the good item. But with my tiny java client, i have the following error : java.io.IOException: Server returned HTTP response code: 400 for URL: localhost/.../Part eq '1 ' at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) You can see the URL is clearly the same as the one i test in Postman. Any ideas ? Thank you !

2 Replies

  • Hello, I don't have experience with calling the Rest API from Java, but it could be that the spaces in the URL are causing this error. Could you try encode both the space (' ') and the apostrophe characters (') to see if this resolves this issue? You can see a full list of URL character encodings here, but for convenience, your new URL would look like localhost/.../Part . Chris
    Christopher Gillis Aras Labs Software Engineer  
  • Hello,   Thanks, the new Url with encoded white spaces work well ! Thank you !