MIME-RPC Examples

HTTP with x/www-form-urlencoded

Request:
POST /some/resource HTTP/1.1
Content-type: application/x-www-form-urlencoded

0=example.getStateName&1=10023
Response:
HTTP/1.1 200 OK
Content-type: text/plain

New York

HTTP x/www-form-urlencoded namedArgs getTeam

POST /some/resource HTTP/1.1
Content-type: application/x-www-form-urlencoded

0=example.getTeam&state=New%20York&sport=Baseball

HTTP/1.1 200 OK
Content-type: multipart/mixed, boundary=B

--B

Yankees
--B

Mets
--B

HTTP x/www-form-urlencoded unicode addUser

POST /some/resource HTTP/1.1
Content-type: application/x-www-form-urlencoded

0=example.addUser&fname=Igna%ACio&lname=Sanchez

HTTP with multipart/form-data

Request:
POST /some/resource HTTP/1.1
Content-type: multipart/form-data, boundary=AaB03x

--AaB03x
content-disposition: form-data; name="field1"

Joe Blow
--AaB03x
content-disposition: form-data; name="pics"; filename="file1.gif"
Content-type: image/gif
Content-Transfer-Encoding: binary


...contents of file1.gif...
 --AaB03x--
Response:
HTTP/1.0 200 OK
Content-type: text/plain

OK

Uploading multiple files with unicode

POST /foo HTTP/1.0
Content-type: multipart/form-data, boundary=AaB03x

--AaB03x
content-disposition: form-data; name="field1"

Joe Blow
--AaB03x
content-disposition: form-data; name="pics"
Content-type: multipart/mixed, boundary=BbC04y

--BbC04y
Content-disposition: attachment; filename="file1.txt"
Content-Type: text/plain; charset=UNICODE-1-1
Content-Transfer-Encoding: binary

... contents of some unicode file.txt ...
--BbC04y
Content-disposition: attachment; filename="file2.gif"
Content-type: image/gif
Content-Transfer-Encoding: binary

...contents of file2.gif...
--BbC04y--
--AaB03x--

XML and EMail

HTP Request
POST /x/foo/bar HTTP/1.0
reply-to-url: callback@domain.com
message-id: abc123
aynch: required

0=getAuthorization&1="bobjones"
HTTP Response
HTTP/1.0 200 OK
delivered-to: callback@domain.com
Content-length: 0

Mail/SMTP Response
To: callback@domain.com
From: mimeRPC@otherplace.com
in-reply-to: abc123
content-type: text/xml

<?xml version="1.0"?>
<this><is /><xml /></this>


(c) Copyright 2001 i2x, Inc.
MIME-RPC(tm) is a trademark of i2x, Inc.