# Is it possible to do a HTTP post from a Processing program?

**URL:** <https://discourse.processing.org/t/is-it-possible-to-do-a-http-post-from-a-processing-program/32224>\
**Category:** Libraries\
**Created:** [September 13, 2021, 7:42am UTC](https://discourse.processing.org/t/is-it-possible-to-do-a-http-post-from-a-processing-program/32224 "2021-09-13T07:42:02Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 17, 2021, 10:17pm UTC](https://discourse.processing.org/t/is-it-possible-to-do-a-http-post-from-a-processing-program/32224/3 "2021-09-17T22:17:36Z")

</div>

For POST specifically note that for Processing 4 / Java11+, posting can be done through java.net.http.HttpClient.

An example (in Java):

> **[How to send HTTP GET POST request in Java with HttpURLConnection and HttpClient](https://zetcode.com/java/getpostrequest/)**
>
> Java HTTP GET/POST tutorial shows how to send
> a GET and a POST request in Java. We use built-in HttpURLConnection class and
> standard Java and Apache HttpClient class.

…and the library documentation:

[https://openjdk.java.net/groups/net/httpclient/intro.html](https://openjdk.java.net/groups/net/httpclient/intro.html)

However, isn’t available in Java 7-8 / Processing 3.x. For that, you can use the HTTP Requests For Processing by Madson and Shiffman – the library is installed through Contributions Manager. Here are related discussions:

> [@Please, help me. API Post method, I want to solve it](https://discourse.processing.org/t/please-help-me-api-post-method-i-want-to-solve-it/29328/3):
>
> The link has been modified so that you can view the material. How to write the end point? How to make a post form? I wonder.

> [@Processing Network HTTP Request Help](https://discourse.processing.org/t/processing-network-http-request-help/17069/2):
>
> Try examples here: slight_smile

> [@HTTP POST Request Issue](https://discourse.processing.org/t/http-post-request-issue/4338):
>
> Hi there, At a basic level, i’ve got a Raspberry Pi with MusicBox loaded. I’m using a second machine to change the audio using HTTP requests. My request is - { “method”: “core.playback.get\_current\_tl\_track”, “jsonrpc”: “2.0”, “id”: 1 } posted with the header “Content-Type”, “application/json”);" If I use another peice of software, for example Postman, to send the string, it works. I’m using the HTTP Request library from Dan Shiftman. The issue, i think, is when I use post.addData it requires…

---

_[View the full topic](https://discourse.processing.org/t/is-it-possible-to-do-a-http-post-from-a-processing-program/32224)._
