<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://startofentry.blogdns.org/rdf'>
    <s:Snip rdf:ID='midlet.post'
         s:name='midlet.post'
         s:cUser='case'
         s:oUser='case'
         s:mUser='case'>
        <s:content>1 Motivation&#xA;For the [WorkingTime] [midlet] I needed HTTP POST to get data from my mobile to the outer world. As the internet offers open formmail cgi scripts and services, I thought this would be easy to use...&#xA;&#xA;1 Trap&#xA;All my emulators worked fine with code as below having the output stream flushed in the end. On my device and within the Sun J2ME Toolkit, the cgi call failed, because the server complained about content-length and chunked data... I searched a lot and finally got the info, that flush() within device implementations might cause unforseen data changing... So simply leave it away. It worked on my Nokia 6610 quite fine after that change, even &apos;larger&apos; (600 Bytes) ones worked.&#xA;&#xA;{code}&#xA;c = (HttpConnection) Connector.open(POST_URL);&#xA;c.setRequestMethod(HttpConnection.POST);&#xA;c.setRequestProperty(&#xA;   &quot;IF-Modified-Since&quot;,&#xA;   &quot;25 Nov 2001 15:17:19 GMT&quot;);&#xA;c.setRequestProperty(&#xA;   &quot;User-Agent&quot;,&#xA;   &quot;Profile/MIDP-1.0 Configuration/CLDC-1.0&quot;);&#xA;c.setRequestProperty(&quot;Content-Language&quot;, &quot;en-CA&quot;);&#xA;c.setRequestProperty(&#xA;   &quot;Content-Type&quot;,&#xA;   &quot;application/x-www-form-urlencoded&quot;);&#xA;os = c.openOutputStream();&#xA;os.write(postmsg);&#xA;// flush will cause message to be chunked on device! Webserver rejects!&#xA;//os.flush();&#xA;os.close();&#xA;{code}</s:content>
        <s:mTime>2003-06-13 20:37:50.12</s:mTime>
        <s:cTime>2003-06-13 20:37:36.64</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='#Midlet'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='#midlet'/>
                <rdf:li rdf:resource='#WorkingTime'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
