Giter Site home page Giter Site logo

python-translator-wsgi-flask's Introduction

python-translator-wsgi-flask

1 - Launch WSGISERVICE APP

python app-wsgiservice.py

curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Accept: application/json" -d "/text" "http://localhost:8000/text=Hello+world.+Hs+the+sun+risen+on+you+today%3F"

{"language": "en"}

curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Accept: application/json" -d "/text" "http://localhost:8000/text=Vaig+neixer+a+un+lloc+molt+bonic%3F"

{"language": "ca"}

curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Accept: application/json" -d "/text" "http://localhost:8000/text=Pero+hace+casi+doce+años+que+estoy+en+fuera%3F"

{"language": "es"}

2 - Launch WSGI APP

python app-wsgi.py

$ curl -i -H "Content-Type: application/json" -X POST -d '{"text":"Je suis Francais"}' http://localhost:8080/ HTTP/1.0 200 OK Date: Thu, 09 Jul 2015 19:54:40 GMT Server: WSGIServer/0.1 Python/2.7.6 Content-Type: application/json Content-Length: 18

{"language": "fr"}

$ curl -i -H "Content-Type: application/json" -X POST -d '{"text":"Yo soy español"}' http://localhost:8080/ HTTP/1.0 200 OK Date: Thu, 09 Jul 2015 19:54:45 GMT Server: WSGIServer/0.1 Python/2.7.6 Content-Type: application/json Content-Length: 18

{"language": "es"}

$ curl -i -H "Content-Type: application/json" -X POST -d '{"text":"I am English"}' http://localhost:8080/ HTTP/1.0 200 OK Date: Thu, 09 Jul 2015 19:54:48 GMT Server: WSGIServer/0.1 Python/2.7.6 Content-Type: application/json Content-Length: 18

{"language": "en"}

3 - Launch Flask APP

$python app-flask.py

$ curl -i -H "Content-Type: application/json" -X POST -d '{"text":"Je suis Francais"}' http://localhost:8080/ HTTP/1.0 201 CREATED Content-Type: application/json Content-Length: 22 Server: Werkzeug/0.10.4 Python/2.7.6 Date: Thu, 09 Jul 2015 19:54:13 GMT

{ "language": "fr" }

$ curl -i -H "Content-Type: application/json" -X POST -d '{"text":"Yo soy español"}' http://localhost:8080/ HTTP/1.0 201 CREATED Content-Type: application/json Content-Length: 22 Server: Werkzeug/0.10.4 Python/2.7.6 Date: Thu, 09 Jul 2015 19:54:21 GMT

{ "language": "es" }

$ curl -i -H "Content-Type: application/json" -X POST -d '{"text":"I am English"}' http://localhost:8080/ HTTP/1.0 201 CREATED Content-Type: application/json Content-Length: 22 Server: Werkzeug/0.10.4 Python/2.7.6 Date: Thu, 09 Jul 2015 19:54:28 GMT

{ "language": "en" }

python-translator-wsgi-flask's People

Contributors

alexvaque avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.