How do you do an HTTP Put?

前端 未结 11 1972
孤独总比滥情好
孤独总比滥情好 2020-12-04 14:19

We have this software that has a webservices component.

Now, the administrator of this system has come to me, wanting to import data into the system by using the webs

相关标签:
11条回答
  • 2020-12-04 14:41

    Here is a tool that lets you drag and drop to PUT files

    0 讨论(0)
  • 2020-12-04 14:48

    PUT and DELETE are likely to require that you use AJAX and make XMLHttpRequests since the FORM tag only supports GET and POST verbs and links only make GET requests.

    With jQuery:

     $.ajax( {
           url: '/controller/action',
           type: 'PUT',
           data: function() { ...package some data as XML },
           dataType: 'xml',
           ... more options...
     );
    

    The note on the jQuery ajax options page warns that some browsers don't support PUT and DELETE for the request type. FWIW, I've never used PUT but have used DELETE in IE and FF. Haven't tested in Safari or Opera.

    0 讨论(0)
  • 2020-12-04 14:51

    You can't PUT using an HTML form (the spec defines only GET/POST for forms).

    However any HTTP API should allow you to PUT, in the same way that it allows you to GET or POST. For example, here's the Java HTTPClient documentation, which details PUT alongside all the other HTTP verbs.

    I don't know which language you're using, but I think it's going to be pretty trivial to write an app to perform an HTTP PUT.

    0 讨论(0)
  • 2020-12-04 14:51

    Test the api as a chrome extension https://chrome.google.com/webstore/detail/fdmmgilgnpjigdojojpjoooidkmcomcm

    0 讨论(0)
  • 2020-12-04 14:52

    How about giving libcurl.NET a try: http://sourceforge.net/projects/libcurl-net/

    0 讨论(0)
提交回复
热议问题