How to send HTTP-PUT-request?

Hello all,

I am trying to make use of the REST interface in processing,

I am currently using the "HTTP Requests for Processing" and I'm successfully able to read the information I want using the GET method, but what I really need is to send a PUT request. Ideally I would like something equivivalent to p5.js's function httpDo().

I am a bit new to web-programming, especially in processing. Can anyone please point me in the right direction, be it a library or another form discussion I would appreciate it greatly,

Thanks in advance!

Tagged:

Answers

  • Answer ✓

    that library allows GET and POST only. it's pretty basic.

    i have a patched version here that allows PUT (see bottom of readme): https://github.com/acdean/HTTP-Requests-for-Processing

    the whole thing needs doing properly, really.

  • Thanks @koogs! I haven't had time to keep the library up to date, but would love to fix it up this summer. If you'd like to pull request stuff please feel free!

  • What other things are needed in this library @koogs? Could you comment in the current status, what it does well currently, what could be improved and what other concepts should be implemented?

    Kf

  • oh, i've been adding bits to it as people here have wanted them so it's all gone a bit organic (see the PUT kludge). other people have added other interesting bits (oauth did i see?) and i wouldn't like to have to merge them back together now.

    if i was doing it from scratch i'd have an input class and an output class and GET, HEAD, DELETE etc would extend the input class, PUT and POST would extend the output class.

    methods to add data to the request as either request params or body data. the latter as name / value pairs, binary content, binary content from a file, string content etc (json, xml). and headers. i think my version might have a lot of these already but not in any well-designed way 8)

  • i'd also get rid of all the tabs in the source files.

  • Thanks for the help all :)

Sign In or Register to comment.