如何从ImageShack API获取XML响应?

时间:2022-11-27 17:33:10

i'm using ImageShack API and this is my code:

我正在使用ImageShack API,这是我的代码:

    <form method="post" enctype="multipart/form-data" action="http://www.imageshack.us/upload_api.php?">

        <p><input type="file" name="fileupload"></p>
        <p>Tags:<input type="text" name="tags" value=""></p>
        <p><input type="text" name="key" value="xxxx"></p>
        <p><select name="optsize">
                <option value="320x240">Small (320x240)</option>
                <option value="426x320" selected>Medium (426x320)</option>
                <option value="640x480">Big (640x480)</option>
            </select></p>
        <p><input type="submit" value="Go"></p>
    </form>

It works fine, but when i click 'Go' appears in my web browser the whole file XML that came as response, i need get this response in my servlet or JSP.

它工作正常,但是当我点击“Go”在我的Web浏览器中出现作为响应的整个文件XML时,我需要在我的servlet或JSP中获得此响应。

How do i get this XML response ?

我如何获得此XML响应?

Best regards, Valter Henrique.

此致,Valter Henrique。

1 个解决方案

#1


0  

You need to make the mutlipart post request from your servlet.

您需要从servlet发出mutlipart post请求。

HttpClient would enable you to do this. That's fairly involved but I think this is a good example of how to do it.

HttpClient可以让你这样做。这是相当复杂的,但我认为这是如何做到这一点的一个很好的例子。

http://evgenyg.wordpress.com/2010/05/01/uploading-files-multipart-post-apache/

#1


0  

You need to make the mutlipart post request from your servlet.

您需要从servlet发出mutlipart post请求。

HttpClient would enable you to do this. That's fairly involved but I think this is a good example of how to do it.

HttpClient可以让你这样做。这是相当复杂的,但我认为这是如何做到这一点的一个很好的例子。

http://evgenyg.wordpress.com/2010/05/01/uploading-files-multipart-post-apache/