title: orientdb (rest api) sql query error using curl
body: <p>On the command line I try this:</p>
  
  <pre><code>curl --user admin:admin -XGET "http://localhost:2480/query/demo/sql/select from Profile/20/*:-1"
  </code></pre>
  
  <p>And get this</p>
  
  <pre><code>from Profile/20/*:-1"
  from 500 Internal Server Error
  Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  Pragma: no-cache
  Date: Wed Oct 17 10:25:57 CDT 2012
  Content-Type: text/plain; charset=utf-8
  Server: OrientDB Server v.1.2.0 (build 12659)
  Connection: Keep-Alive
  Content-Length: 72
  
  java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  </code></pre>
  
  <p>Then I try this:</p>
  
  <pre><code>curl --user admin:admin "http://localhost:2480/query/demo/sql/select from Profile/20/*:-1"
  </code></pre>
  
  <p>And get this</p>
  
  <pre><code>java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  </code></pre>
  
  <p>Edit:</p>
  
  <p>I'm using the 1.2.0 version in ubuntu 12.04</p>
  
  <p>Edit 2:</p>
  
  <p>if I access from google chrome to:</p>
  
  <pre><code>http://localhost:2480/query/demo/sql/select%20from%20Profile/20/*:-1
  </code></pre>
  
  <p>It works. So I think is something in the curl request.</p>
  
  <p>Edit 3:</p>
  
  <p>I try adding this headers and the same error came out</p>
  
  <pre><code>Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
  Accept-Encoding:gzip,deflate,sdch
  Accept-Language:en-US,en;q=0.8
  Authorization:Basic YWRtaW46YWRtaW4=
  Cache-Control:max-age=0
  Connection:keep-alive
  Cookie:OSESSIONID=-
  Host:127.0.0.1:2480
  User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/535.19
  </code></pre>