Skip to content

Instantly share code, notes, and snippets.

@Dispader
Created November 16, 2015 06:19
Show Gist options
  • Save Dispader/b1fb6ad04d4913be86d7 to your computer and use it in GitHub Desktop.
Save Dispader/b1fb6ad04d4913be86d7 to your computer and use it in GitHub Desktop.
example of calling online OCR web service
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7' )
import groovy.io.FileType
import groovyx.net.http.RESTClient
import static groovyx.net.http.ContentType.*
def standingsFile = new File('./src/test/resources/2015/fall/advsundiv.pdf')
def client = new RESTClient( 'http://beta.offenedaten.de:9998/tika' )
def response = client.put( requestContentType: BINARY, body: standingsFile.bytes )
println response.data.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment