# Simple example http client mopidy

**URL:** <https://discourse.mopidy.com/t/simple-example-http-client-mopidy/2051>\
**Category:** Misc\
**Created:** [November 22, 2017, 12:59pm UTC](https://discourse.mopidy.com/t/simple-example-http-client-mopidy/2051 "2017-11-22T12:59:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Roosen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/peter_roosen/32/767_2.png) [@Peter\_Roosen](https://discourse.mopidy.com/u/Peter_Roosen)\
**Post date:** [November 22, 2017, 12:59pm UTC](https://discourse.mopidy.com/t/simple-example-http-client-mopidy/2051/1 "2017-11-22T12:59:50Z")

</div>

Hi all,

I’m trying to develop a physical product that interacts with mopidy, friends of mine advised working with sending http request by using json. I was wondering if anyone has a simple example code which is able to do minor actions with mopidy through http requests, such as play a song or request a playlist.

If I could use this example code I might be able to grasp a bit better how all this works. I have almost no experience with this, but I have quite some experience in other programming languages. So I hope an example program might push me in the right direction. I already looked at the javascript library, but that still didn’t give me a lot of fo clarity.

thanks everyone

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [November 22, 2017, 2:19pm UTC](https://discourse.mopidy.com/t/simple-example-http-client-mopidy/2051/2 "2017-11-22T14:19:53Z")

</div>

Is there a problem using the exmaple curl commands provided by mopidy-api-explorer that I already suggested in [Can't connect MPD & Can't use spotify pimusicbox](https://discourse.mopidy.com/t/cant-connect-mpd-cant-use-spotify-pimusicbox/2047/4) ?

Also see [Control mopidy by python code](https://discourse.mopidy.com/t/control-mopidy-by-python-code/1590) and [Trigger Play / Pause from HTTP request](https://discourse.mopidy.com/t/trigger-play-pause-from-http-request/1217/2)

---

<div class="post-metadata">

**Author:** ![Peter\_Roosen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/peter_roosen/32/767_2.png) [@Peter\_Roosen](https://discourse.mopidy.com/u/Peter_Roosen)\
**Post date:** [November 23, 2017, 8:26am UTC](https://discourse.mopidy.com/t/simple-example-http-client-mopidy/2051/3 "2017-11-23T08:26:33Z")

</div>

There is no problem with those at all, I’m just at the moment not seeing how I can put it in a program. But I will check your other links to see if I figure it out with those.

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [November 23, 2017, 9:07am UTC](https://discourse.mopidy.com/t/simple-example-http-client-mopidy/2051/4 "2017-11-23T09:07:08Z")

</div>

Ah OK. You may find the python mpd2 library is the easiest way to get going: [https://pythonhosted.org/python-mpd2/topics/getting-started.html](https://pythonhosted.org/python-mpd2/topics/getting-started.html)
