Avro
  1. Avro
  2. AVRO-322

Add a working client and server to Python implementation using HTTP as a transport

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: python
    • Labels:
      None
    1. AVRO-322.patch
      19 kB
      Jeff Hammerbacher

      Issue Links

        Activity

        Hide
        Jeff Hammerbacher added a comment -

        Here's a copy of the avroj HTTP request for the mailbox protocol:

        POST / HTTP/1.1
        Content-Type: avro/binary
        Content-Length: 63
        User-Agent: Java/1.6.0_17
        Host: localhost:9090
        Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
        Connection: keep-alive
        
        7KK??m??)??ő7KK??m??)??ősenavrjeffhey
        
        Show
        Jeff Hammerbacher added a comment - Here's a copy of the avroj HTTP request for the mailbox protocol: POST / HTTP/1.1 Content-Type: avro/binary Content-Length: 63 User-Agent: Java/1.6.0_17 Host: localhost:9090 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Connection: keep-alive 7KK??m??)??ő7KK??m??)??ősenavrjeffhey
        Hide
        Jeff Hammerbacher added a comment -

        Note that Python 2.x has support for HTTP sprinkled across several modules and none of which support parsing requests in the same fashion as parsing results. To support HTTP as a transport in Python is going to require some hand-coded HTTP parsing, yay.

        Remind me again why we're focused on HTTP as a transport instead of TCP sockets?

        Also, for the record, Python 3.x is far more sane with respect to HTTP: http://diveintopython3.org/porting-code-to-python-3-with-2to3.html#http

        Show
        Jeff Hammerbacher added a comment - Note that Python 2.x has support for HTTP sprinkled across several modules and none of which support parsing requests in the same fashion as parsing results. To support HTTP as a transport in Python is going to require some hand-coded HTTP parsing, yay. Remind me again why we're focused on HTTP as a transport instead of TCP sockets? Also, for the record, Python 3.x is far more sane with respect to HTTP: http://diveintopython3.org/porting-code-to-python-3-with-2to3.html#http
        Hide
        Doug Cutting added a comment -

        The API in http://docs.python.org/library/basehttpserver.html looks pretty simple to me. You extend BaseHTTPRequestHandler and implement do_POST() and/or do_GET(). The request can be read from rfile. It looks like you need to call send_response(200) and end_headers() before writing the response to wfile. What am I missing?

        Show
        Doug Cutting added a comment - The API in http://docs.python.org/library/basehttpserver.html looks pretty simple to me. You extend BaseHTTPRequestHandler and implement do_POST() and/or do_GET(). The request can be read from rfile. It looks like you need to call send_response(200) and end_headers() before writing the response to wfile. What am I missing?
        Hide
        Jeff Hammerbacher added a comment -

        Committed revision 906394 and revision 906397.

        Show
        Jeff Hammerbacher added a comment - Committed revision 906394 and revision 906397.

          People

          • Assignee:
            Jeff Hammerbacher
            Reporter:
            Jeff Hammerbacher
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development