Has anyone tried to combine dispatch 0.9.3 and the REST API ..
I am having trouble posting data to my orientdb server. It does work with curl so I know the problem does not lie with the REST API. I would just like to know if anybody has any insight on the 505 error or the exception raised on the server.
Response DefaultHttpResponse(chunked: false)
HTTP/1.1 505 Error on executing of POST for the resource: /document/restTest
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Date: Sun Nov 04 22:55:56 EST 2012
Content-Type: text/plain; charset=utf-8
Server: OrientDB Server v.1.2.0 (build @BUILD@)
Connection: Keep-Alive
Content-Length: 30
Request DefaultHttpRequest(chunked: false)
POST /document/restTest HTTP/1.1
Host: localhost:2480
Connection: keep-alive
Accept: */*
User-Agent: NING/1.0
Content-Length: 61
Server.sh throws ...
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
at com.orientechnologies.orient.enterprise.channel.text.OChannelText.read(OChannelText.java:57)
at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.readAllContent(ONetworkProtocolHttpAbstract.java:329)
at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.execute(ONetworkProtocolHttpAbstract.java:518)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:43)
scala code ...
val uri = url("
http://localhost:2480/document/restTest").as(username, pwd)
executer(uri.POST.setBody("{\"@class\":\"User\",\"name\":\"Ant Jones\",\"email\":\"
An...@email.com\"}"))
I was able to use dispatch 0.9.3 to create a class on my server instance using
protected lazy val executer = new Http
val reqHost = url("
http://localhost:2480/class/restTest/Track").as_!(username, pwd)
executer(reqHost.POST)