Is it possible to do a HTTP PUT with one of the plugins? Or can I do RAW HTTP POST or MULTI-PART HTTP POST?
I’ve been trying to use the current HTTP plugins with an online photo site and accessing the database there works. However when I try using the getPoster
to upload a jpg and follow all the examples here on using it it still won’t work. I get a "msg=“system error (nofiles)” returned from the .getPageData() from the server.
All the L_Poster.addParameter .addFile returns “true”.
I’m new to doing this so maybe I’m just not undertstanding all the different functions.
Thanks for any help,
Steve
Hi Steve,
I have not found a way of doing it.
Luckily I was accessing my own web service, so I rewrote it in a non-REST way to work within the limitations of the http plugin.
JapanDev:
Is it possible to do a HTTP PUT with one of the plugins? Or can I do RAW HTTP POST or MULTI-PART HTTP POST?
Yes this works for sure, we actually know that people post servoy solution files with it to the admin-page of servoy servers to have solutions updated.
Not sure if there is anything to add to the sample code, if you post files the post be comes multi-part.
I’m trying to do the functions here on this page http://smugmug.jot.com/WikiHome/API/Uploading .
Oh yeah I know post works using the plugin, I should of left that part out ( I figured it out after my forum post that it was a Multi-part Post. But what I was actually wondering if it could do HTTP PUT or RAW POST. I couldn’t get MULTI-PART HTTP POST to work with my site at Smugmug. The MULTI-PART HTTP POST that Smugmug wants wasn’t working (Smugmug returns an error “No file”. I’m really sure I was following the instructions here on the forums correctly on how to post a file. I’m still trying to determine if something is wrong with the plugin or Smugmugs API or if the problem is elsewhere (I’m using Japanese Windows XP). I have no problems with any other APIs at Smugmug.
I wanted to try the other methods they have listed like HTTP PUT or RAW HTTP POST because I couldn’t get MULTI-PART HTTP POST to work.
Id like to keep it all in Servoy because if I give the solution to somebody they can make changes. However if I can’t get it to work I’m going to make a plugin using the Smugmug Java API.
Steve
There currently no support for HTTP PUT and we are unfamiliar with RAW HTTP POST.
It would be nice to be able to work with REST web services from Servoy. REST is much simpler from a developer point of view than (most?) other ways of accessing web services.
Is it possible to add an extra parameter to the HTTP plugin to override the http Verb? GET, PUT, DELETE and POST (maybe also HEAD and OPTIONS – HEAD is used by Amazon S3 when you want to fetch the metadata of an object, but not the object itself)
If you take a look at Rails, if you want to override the HTTP verb when constructing a URL, you can add a
:method => :delete
That’s all you need to do.
I hope Servoy will make it just as easy.
For more on REST, check out “Restful Web Services” from O’Reilly. It is a very well written book.
I would like to put in my vote for PUT/DELETE support also if its possible. As I too have RESTful web services that I write (in pylons if curious) and access with servoy.
I was able to make a Servoy plugin that uses HTTP PUT. It’s made to only work for one site which was pretty easy. Making a general purpose one looks be me more work but doable.
Steve