Request.New1 ( "http://www.tumblr.com/api/write")
Request.Method = "POST"
Request.KeepAlive = True
Request.ContentType = "application / x-www-form-urlencoded"
stream.New1 (Request.GetStream, True)
name = "email = mail & password = pass"
stream.WriteBytes (stream.StringToBytes (name))
Response.New1
Request.GetAsyncResponse
Obj1.New1(False)
...
Request.New1(URL)
Obj1.FromLibrary (Request, "req", B4PObject(2))
Obj1.Value = Obj1.GetProperty("ServicePoint")
Obj1.SetPproperty("Expect100Continue", False)
...
response.New1
Obj1.New1(False)
request.New3("http://twitter.com/statuses/update.xml",tbUser.Text,tbPass.Text)
Obj1.FromLibrary ("Main.Request", "req", B4PObject(2))
Obj1.Value = Obj1.GetProperty("ServicePoint")
Obj1.SetProperty("Expect100Continue", False)
request.Method = "POST"
request.TimeOut = 30000
writer.New1(Request.GetStream,False)
Parameters = "status=" & tbStatus.Text
writer.WriteBytes(writer.StringToBytes(Parameters))
Response.Value = Request.GetResponse
temp = Response.GetString
Response.Close
Msgbox(temp)
Are you sure that your device has Compact Framework 2.0 installed?It will only work on .NET 2.0 on a device (if it works at all!).
So unfortunately it looks like this won't work on a deviceWindows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows CE Platform Note: This property is null until the request is sent because of the additional network transmission required.
That's what the Door library code I posted above does - and it works on the desktop. The problem is that on the device the ServicePoint is not actually assigned until GetResponse is called and then it is too late. The actual C# code in the SubmitResponse method of HttpWebRequest on the device isbut you might try to use the ServicePointManager class
...
ServicePoint point = ServicePointManager.FindServicePoint(this.m_url, setProxy);
this.[COLOR="Red"]m_srvPoint [/COLOR]= point;[COLOR="Green"] // ServicePoint assigned[/color]
this.prepareHeaders();
this.m_requestSent = true;
if (this.m_boundConnection != null)
{
this.m_boundConnection.m_srvPoint = point;
this.m_boundConnection.[COLOR="red"]submitRequest[/COLOR](this);[COLOR="Green"] // send request[/COLOR]
}
else
{
point.SubmitRequest(this, this.GetConnectionGroupLine());
}
obj1.New1(False)
obj1.CreateNew("System.Net.ServicePointManager" & obj1.System_NS)
obj1.SetProperty("Expect100Continue", False)
Do you think that it is related to the Expect header? Can you see the actual request in the server logs?On the desktop works on the device I get an error:
Response code: -1
ReceiveFailure
Do you think that it is related to the Expect header? Can you see the actual request in the server logs?
POST /statuses/update.xml HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Authorization: Basic QXNwaXJlODk6Njc2OTg5MjYx
Host: twitter.com
Content-Length: 10
status=111
HTTP/1.1 200 OK
Date: Wed, 26 Aug 2009 16:12:50 GMT
Server: hi
Last-Modified: Wed, 26 Aug 2009 16:12:50 GMT
Status: 200 OK
ETag: "95c29f721eb3a3158c936ef3c316ef91"
Pragma: no-cache
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Content-Type: application/xml; charset=utf-8
Content-Length: 1721
Expires: Tue, 31 Mar 1981 05:00:00 GMT
X-Revision: d480fb2179a9d77a12d84649a8cddb7781039783
X-Transaction: 1251303170-18736-3013
Set-Cookie: lang=en; path=/
Set-Cookie: lang=en; path=/
Set-Cookie: _twitter_sess=BAh7CjoTcGFzc3dvcmRfdG9rZW4iLWUzMWQzMzIxMzYzNjViODZmNjE2Zjdh%250AMWE4MmUxNjE1ZGY2MDZmZmM6CXVzZXJpBHf6BwE6DGNzcmZfaWQiJWQyZjUx%250AOGMzYmYzM2I4ZDBiOGI1YTA1NGI4MzA0YTNkOgdpZCIlODQwYzA4NjU1NWI1%250ANDE0MzFlN2Y0MWJhYTdiN2JjMGYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xs%250AZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA%253D--14a75279178086f72163ae85166f5b7f5e650a0d; domain=.twitter.com; path=/
Vary: Accept-Encoding
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<status>
<created_at>Wed Aug 26 16:12:50 +0000 2009</created_at>
<id>3559064512</id>
<text>111</text>
<source><a href="http://apiwiki.twitter.com/" rel="nofollow">API</a></source>
<truncated>false</truncated>
<in_reply_to_status_id></in_reply_to_status_id>
<in_reply_to_user_id></in_reply_to_user_id>
<favorited>false</favorited>
<in_reply_to_screen_name></in_reply_to_screen_name>
<user>
<id>17300087</id>
<name>Aspire89</name>
<screen_name>Aspire89</screen_name>
<location></location>
<description></description>
<profile_image_url>http://a1.twimg.com/profile_images/69905926/535_normal.jpg</profile_image_url>
<url>http://aspire89.tumblr.com/</url>
<protected>false</protected>
<followers_count>17</followers_count>
<profile_background_color>1A1B1F</profile_background_color>
<profile_text_color>666666</profile_text_color>
<profile_link_color>2FC2EF</profile_link_color>
<profile_sidebar_fill_color>252429</profile_sidebar_fill_color>
<profile_sidebar_border_color>181A1E</profile_sidebar_border_color>
<friends_count>25</friends_count>
<created_at>Tue Nov 11 01:34:00 +0000 2008</created_at>
<favourites_count>0</favourites_count>
<utc_offset>18000</utc_offset>
<time_zone>Ekaterinburg</time_zone>
<profile_background_image_url>http://s.twimg.com/a/1250809294/images/themes/theme9/bg.gif</profile_background_image_url>
<profile_background_tile>false</profile_background_tile>
<statuses_count>70</statuses_count>
<notifications>false</notifications>
<verified>false</verified>
<following>false</following>
</user>
</status>
POST /statuses/update.xml HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: twitter.com
Authorization: Basic QXNwaXJlODk6Njc2OTg5MjYx
Content-Length: 10
Connection: Keep-Alive
status=222
HTTP/1.1 403 Forbidden
Date: Wed, 26 Aug 2009 16:18:50 GMT
Server: hi
Last-Modified: Wed, 26 Aug 2009 16:18:50 GMT
Status: 403 Forbidden
Pragma: no-cache
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Content-Type: application/xml; charset=utf-8
Content-Length: 168
Expires: Tue, 31 Mar 1981 05:00:00 GMT
X-Revision: d480fb2179a9d77a12d84649a8cddb7781039783
X-Transaction: 1251303530-21871-6900
Set-Cookie: lang=en; path=/
Set-Cookie: lang=en; path=/
Set-Cookie: _twitter_sess=BAh7CjoJdXNlcmkEd%252FoHAToMY3NyZl9pZCIlMDlkYTQyMjczOTljZmIwODY3%250AMjUzNTI0Y2I1ZGZiNWU6B2lkIiUxN2FlODljNGU0ZjBiYmUyZjIzOGIwMjBl%250AZmZmOTViYSIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZs%250AYXNoSGFzaHsABjoKQHVzZWR7ADoTcGFzc3dvcmRfdG9rZW4iLWUzMWQzMzIx%250AMzYzNjViODZmNjE2ZjdhMWE4MmUxNjE1ZGY2MDZmZmM%253D--53c13ea08f2dede40de256e75be5d0efcd0a0d6d; domain=.twitter.com; path=/
Vary: Accept-Encoding
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<request>/statuses/update.xml</request>
<error>Client must provide a 'status' parameter with a value.</error>
</hash>
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?