![]() |
|
|
#1 |
|
Registered User
![]() |
Using web APIs -TweetPhoto.
Hi,
I'm trying to develop a small app to upload to TweetPhoto using the API with Visual Basic. I'm not really to sure about how to use this. I ama aware that I need to setup a WebRequest object then setup headers etc but i'm getting lost along the way. Does anybody know of any tutorials on how to use these Web APIs with VB? I'm not having much luck with Google as I don't really know what to look for. What is the proper name for a web API like this? Web Service?? |
|
|
|
|
Advertisement
|
|
To remove these adverts, please create an account, or log in! You must have an account to post anyway :-) |
|
|
#3 |
|
Registered User
![]() |
I'm using VB.NET 3.5
I found out that TweetPhoto uses the REST web service protocol but have yet to find a decent gudie on this. My main problems are serializing the image to a byte array then streaming the data along with headers to the tweetphoto site. Has anybody done anything like this before? |
|
|
|
|
|
#4 |
|
Registered User
![]() |
I can't really help you with the VB stuff but a RESTful web service is pretty straightforward to interact with.
Basically in this case you're using HTTP methods to interact with the web service; GET to read a resource, POST to create a resource, PUT to update a resource and so on. I'm sure there must be some sort of VB library that'll provide the HTTP methods for you; so all you need to do is create the HTTP request and fire it off. All the information on the format of the request should be provided in the documentation for the TweetPhoto API in terms of any headers you need to set etc. A Java implementation example would be; Code:
HTTPRequest request = HTTPClient.createRequest("http://tweetphotoapi.com/api/tpapi.svc/upload2");
request.setMethod("POST");
request.setHeader("TPAPIKEY", "someKey");
request.setContentType("application/x-www-form-urlencoded");
request.setContentLength(imageFile.getLength());
request.setBody(imageFile.getBytes());
Here's a decent article that might help with the HTTP end of things. Last edited by ronivek; 06-11-2009 at 17:35. |
|
|
|
| Thanks from: |
|
|
#5 |
|
Registered User
![]() |
Cool, you make it look pretty easy.
I just found that yahoo link too.. it's pretty useful and easy to read. Thanks for all your help!! |
|
|
|
![]() |
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|