tag:blogger.com,1999:blog-7318041760132105098.post7147418532043320581..comments2017-09-19T18:51:58.865-07:00Comments on Igor Polevoy Blog: Java: REST with ease :)Igor Polevoyhttp://www.blogger.com/profile/03725729050038133735noreply@blogger.comBlogger29125tag:blogger.com,1999:blog-7318041760132105098.post-39435191383197397192014-12-02T09:43:47.754-08:002014-12-02T09:43:47.754-08:00All information related to JavaLite HTTP can be fo...All information related to JavaLite HTTP can be found here: <a href="http://javalite.io/http" rel="nofollow">JavaLite HTTP</a><br /><br />thanksAnonymoushttps://www.blogger.com/profile/12443118048958865837noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-87400100316545696492013-12-04T10:00:38.983-08:002013-12-04T10:00:38.983-08:00Ian, this is under Apache 2 license:
LICENSE.
Yo...Ian, this is under Apache 2 license: <br /><a href="https://github.com/javalite/activejdbc/blob/master/LICENSE" rel="nofollow">LICENSE</a>. <br />You can find the library in Maven Central: <a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22javalite-common%22" rel="nofollow">JavaLite Common</a><br /><br />Hope this helps, cheersAnonymoushttps://www.blogger.com/profile/12443118048958865837noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-65415758424724712402013-12-04T08:30:05.930-08:002013-12-04T08:30:05.930-08:00Hi - this looks neat. What licencing rules are you...Hi - this looks neat. What licencing rules are you releasing it under ? Anonymoushttps://www.blogger.com/profile/02840737677191343016noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-83572983512882969872013-09-25T09:02:24.526-07:002013-09-25T09:02:24.526-07:00Yogesh, this is no different than any other servic...Yogesh, this is no different than any other service. Check this out: http://stackoverflow.com/questions/4599933/how-to-use-an-http-proxy-in-javaAnonymoushttps://www.blogger.com/profile/12443118048958865837noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-35044755784574377532013-09-25T02:04:23.778-07:002013-09-25T02:04:23.778-07:00How to configure proxies with Javalite.???
I tried...How to configure proxies with Javalite.???<br />I tried connecting to http://yahoo.com in office and I got the followign exception.<br /><br />Exception in thread "main" org.javalite.http.HttpException: Failed URL: http://yahoo.com<br /> at org.javalite.http.Request.responseCode(Request.java:102)<br /> at org.javalite.http.Request.text(Request.java:153)<br /> at resttester.RESTTester.main(RESTTester.java:22)<br />Caused by: java.net.ConnectException: Connection refused: connectYogihttps://www.blogger.com/profile/15382350910254695035noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-39102481035453941962013-02-22T04:11:12.365-08:002013-02-22T04:11:12.365-08:00JavaLite works like breeze ...
Get get = Http....JavaLite works like breeze ... <br /><br /> Get get = Http.get("http://localhost:8080/bpm/rest/pageflow/list");<br /> get.header("Authorization", "Basic dGliY28tYWRtaW46c2VjcmV0");<br /> get.header("Accept", "application/json");<br /> get.header("Content-Type", "application/json");<br /> get.header("Host", "http://localhost:8080");<br /><br /> System.out.println(get.text());<br /> <br /> Post post = Http<br /> .post("http://localhost:8080/bpm/rest/pageflow/start/%2FTestRESTService%2FProcess%20Packages%2FTestRESTService.xpdl/TestRESTPageFlows/1.0.0",<br /> "");<br /> post.header("Authorization", "Basic dGliY28tYWRtaW46c2VjcmV0");<br /> post.header("Accept", "application/json");<br /> post.header("Content-Type", "application/json");<br /> post.header("Host", "http://localhost:8080");<br /><br /> <br /> System.out.println(post.text());<br /><br /> Put put = Http.put("http://localhost:8080/bpm/rest/pageflow/update/pvm:0a101/pvm:001g1.7", "");<br /> put.header("Authorization", "Basic dGliY28tYWRtaW46c2VjcmV0");<br /> put.header("Accept", "application/json");<br /> put.header("Content-Type", "application/json");<br /> put.header("Host", "http://localhost:8080");<br /><br /> <br /> System.out.println(put.text());<br /> <br /> Delete delete = Http.delete("http://localhost:8080/bpm/rest/pageflow/cancel/pvm:0a102");<br /> delete.header("Authorization", "Basic dGliY28tYWRtaW46c2VjcmV0");<br /> delete.header("Accept", "application/json");<br /> delete.header("Content-Type", "application/json");<br /> delete.header("Host", "http://localhost:8080");<br /><br /><br /> System.out.println(delete.text());arindamhttps://www.blogger.com/profile/14377168494587753981noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-79430769380370034862013-02-04T14:38:36.785-08:002013-02-04T14:38:36.785-08:00Please, post support questions on the forum: Activ...Please, post support questions on the forum: <a href="https://groups.google.com/forum/?fromgroups#!forum/activejdbc-group" rel="nofollow">ActiveJDBC Google Groups</a><br /><br />thanksAnonymoushttps://www.blogger.com/profile/12443118048958865837noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-87122464144980311122013-02-04T14:37:20.316-08:002013-02-04T14:37:20.316-08:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/12443118048958865837noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-44047078798621148912013-02-04T14:33:58.029-08:002013-02-04T14:33:58.029-08:00Igor,
making a try in using javalite within wavema...Igor,<br />making a try in using javalite within wavemaker.<br />I am getting following errors<br /><br />--snip--<br />1. ERROR in \services\javaInsert\src\com\wavemaker\javaInsert.java (at line 54)<br /> Get get = Http.get("http://yahoo.com");<br /> ^^^<br />Get cannot be resolved to a type<br />----------<br />2. ERROR in \services\javaInsert\src\com\wavemaker\javaInsert.java (at line 54)<br /> Get get = Http.get("http://yahoo.com");<br /> ^^^^<br />Http cannot be resolved<br />--snip--<br /><br />Tried to "import org.javalite.http;" but this mentioned that javalite is a package hence assume I should just be able to use the sample code provided in this post but no joy.<br /><br />Please bear with me, learning java and need assistance and directions.<br /><br />kotin karwakUnknownhttps://www.blogger.com/profile/02243913472800368915noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-615554222947622262013-01-31T20:02:58.156-08:002013-01-31T20:02:58.156-08:00JavaLite supports HTTPS because it is supported by...JavaLite supports HTTPS because it is supported by Java. JavaLite is a very thin layer on top.Anonymoushttps://www.blogger.com/profile/12443118048958865837noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-21625989705844435002013-01-31T16:31:56.408-08:002013-01-31T16:31:56.408-08:00Hi Igor,
A newbie in all things web and delving in...Hi Igor,<br />A newbie in all things web and delving into it using wavemaker as a development tool for a web application. I need to use Java to make use of zotero.org citation facility that uses GET/POST methods to read citations and write new ones. It however requires use of https.<br />My questions, is javalite supporting https. <br />I have been reading on domain restrictions and wonder if using java method bypasses this limitation.Unknownhttps://www.blogger.com/profile/02243913472800368915noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-91575738288714311382012-12-01T12:04:20.519-08:002012-12-01T12:04:20.519-08:00Emmanuel, apparently you endpoint takes time to re...Emmanuel, apparently you endpoint takes time to respond with data, use this method and set your timeouts:<br /><a href="http://ipsolutionsdev.com/activejdbc/org/javalite/http/Http.html#get(java.lang.String,%20int,%20int)" rel="nofollow">http://ipsolutionsdev.com/activejdbc/org/javalite/http/Http.html#get(java.lang.String, int, int)</a><br /><br />thanksAnonymoushttps://www.blogger.com/profile/12443118048958865837noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-58518319563765188982012-12-01T07:49:55.935-08:002012-12-01T07:49:55.935-08:00I keep getting Caused by: java.net.SocketTimeoutEx...I keep getting Caused by: java.net.SocketTimeoutException: Read timed out when i try to retrieve large information using your library. Is there something I am doing wrong?<br /><br />This same url opens perfectly on a browserEmmanuel Kpoudosunoreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-56112733275957968112011-11-03T15:58:10.599-07:002011-11-03T15:58:10.599-07:00Hi Igor,
I am newbiew in using the REST services....Hi Igor,<br /><br />I am newbiew in using the REST services.. Can you please post a simple example of connect, GET and POST using your API's. That would be very helpful.<br /><br />Thanks.<br />Rivyainvisblehttps://www.blogger.com/profile/11100491405334919400noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-20321797622485721562011-10-13T13:07:51.039-07:002011-10-13T13:07:51.039-07:00If you need simple single file executable interfac...If you need simple single file executable interface to play with rest services, it's here<br /><br />http://tinyurl.com/rest-clientYaduhttps://www.blogger.com/profile/18388446465037858805noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-85586998419381164952011-09-02T07:12:06.996-07:002011-09-02T07:12:06.996-07:00Thanks Igor,
This is a very useful and simple solu...Thanks Igor,<br />This is a very useful and simple solution that I was looking for. I am not familiar with Java, coming from Python I was in misery reading code to do for a simple POST to retrieve some JSON data. In Python it's one or two line of code.<br />This is so simple to use. Love it.<br /><br />Cheers,Pierre V.https://www.blogger.com/profile/13655332117151850275noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-35973466322837484642011-04-01T10:06:42.833-07:002011-04-01T10:06:42.833-07:00danhvidding, thanks for yet another contribution :...danhvidding, thanks for yet another contribution :)<br />I incorporated it into code, and the latest build is available for download<br /><br />igorIgor Polevoyhttps://www.blogger.com/profile/03725729050038133735noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-5846090793544849582011-04-01T08:50:42.169-07:002011-04-01T08:50:42.169-07:00Hi Igor,
I also made one small change to the sour...Hi Igor,<br /><br />I also made one small change to the source code of your library... In my case, the api I'm calling also may contain a message in the response body if there is an error response code returned. For instance if the message I send to the service is malformed, and missing a required field- the message I get back will be a 400 Bad Request and the body will have some text detailing what was missing. The code as is throws an exception if I try to read the response body when there is not a 200 OK response. So I changed the following line in the text method in Request.java...<br /><br /><br /> public String text() {<br /> try {<br /> connect();<br /> <b>String result = (this.responseCode() >= 400) ? Util.read(connection.getErrorStream())<br /> : Util.read(connection.getInputStream());</b><br /> dispose();<br /> return result;<br /> } catch (IOException e) {<br /> throw new HttpException(e);<br /> }<br /> }danhviddinghttps://www.blogger.com/profile/13368581409532748739noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-36684471637663018942011-02-24T15:14:40.567-08:002011-02-24T15:14:40.567-08:00Johan, I looked at RestAssured, and it does indeed...Johan, I looked at RestAssured, and it does indeed look good. Somewhat similar to JavaLite Http, but probably goes further in the way you can use it for testing. I also like the DSL you use, I use a similar approach this across all my projects now. I'm working on a new Java web framework ActiveWeb that is similar to Ruby on Rails with ActiveJDBC as a ORM, and using RestAssured for automated testing just makes sense. It should be possible to describe user scenarios in RA. We can certainly collaborate on this. <br />thanks<br />igorIgor Polevoyhttps://www.blogger.com/profile/03725729050038133735noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-27845428658756093712011-02-24T12:51:44.623-08:002011-02-24T12:51:44.623-08:00I've made something similar as this called Res...I've made something similar as this called <a href="http://code.google.com/p/rest-assured/" rel="nofollow">Rest Assured</a>. It also lets you parse XML and JSON responses very easily and authentication etc etc. Perhaps we can do something together.Herregudhttps://www.blogger.com/profile/12229735152615690023noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-31086417977800895722011-02-17T20:09:52.565-08:002011-02-17T20:09:52.565-08:00danhvidding, you are correct, what was I thinking?...danhvidding, you are correct, what was I thinking? :) <br />I corrected the problem and rebuilt the library, feel free to get the latest build. <br /><br />By the way, the method header(x, y) returns self, so that you could chain them like this:<br /><br />header(a, b).header(c, d)...<br /><br />thanks,<br />IgorIgor Polevoyhttps://www.blogger.com/profile/03725729050038133735noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-25324670884691842642011-02-17T17:01:03.338-08:002011-02-17T17:01:03.338-08:00Hi,
I used your library to call a REST service, I...Hi,<br /><br />I used your library to call a REST service, I like it- it's very simple and well commented. One thing I might point out. I had to do a post to the service and set the request header of content-type to "application/json". I used the following lines, <br /><br />Post post = Http.post("http://api.edgecast.com/v2/pcc/customers", postContent);<br /> String token = DBHelper.getEC_API_Token();<br /> post.header("Authorization",("TOK:"+token));<br /> post.header("Accept","application/json");<br /> post.header("Content-Type","application/json");<br /> post.header("Host","api.edgecast.com");<br /> post.header("Content-Length",Integer.toString(bytes));<br /><br /> System.out.println("**********Response Code*****************");<br /> System.out.println(post.responseCode());<br /> System.out.println("**********End Response Code*****************");<br /><br />However, the POST was hardcoding the content-type header to 'text/plain' after I was setting the content-type manually. I went ahead and commented out where that header was set in Post.java and Put.java. Just thought I would drop a comment there in case anyone else runs into it.danhviddinghttps://www.blogger.com/profile/13368581409532748739noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-82309054461987258472011-02-09T23:34:16.730-08:002011-02-09T23:34:16.730-08:00Thanks so much! I completely overlooked the link. ...Thanks so much! I completely overlooked the link. My apologies!najnoreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-3146852022776559492011-02-09T23:07:20.350-08:002011-02-09T23:07:20.350-08:00naj, as I posted above, the link to sources is: ht...naj, as I posted above, the link to sources is: <a href="http://code.google.com/p/activejdbc/source/browse/#svn%2Ftrunk%2Fjavalite-common%2Fsrc%2Fmain%2Fjava%2Fjavalite%2Fhttp" rel="nofollow">http://code.google.com/p/activejdbc/source/browse/#svn%2Ftrunk%2Fjavalite-common%2Fsrc%2Fmain%2Fjava%2Fjavalite%2Fhttp</a><br /><br />thanks,<br />igorIgor Polevoyhttps://www.blogger.com/profile/03725729050038133735noreply@blogger.comtag:blogger.com,1999:blog-7318041760132105098.post-49244086018500562492011-02-09T22:22:50.426-08:002011-02-09T22:22:50.426-08:00Are you posting your source, or just the jar? It&#...Are you posting your source, or just the jar? It's hard to figure out how to use it if there's no javadoc or source. Thanks.najnoreply@blogger.com