# How to use WagoAppHTTP library if never used before

**URL:** <https://www.wago.community/t/how-to-use-wagoapphttp-library-if-never-used-before/712>\
**Category:** Hardware and Linux\
**Tags:** pfc100, how-to, ecockpit\
**Created:** [December 1, 2023, 3:26pm UTC](https://www.wago.community/t/how-to-use-wagoapphttp-library-if-never-used-before/712 "2023-12-01T15:26:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mircarta](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@mircarta](https://www.wago.community/u/mircarta)\
**Post date:** [December 1, 2023, 3:26pm UTC](https://www.wago.community/t/how-to-use-wagoapphttp-library-if-never-used-before/712/1 "2023-12-01T15:26:34Z")

</div>

Hi community i am fairly new on this and i thought i would ask some of you a little help.

I am working with an API which allows me to send single https commands via a web page to the achieve the same result as if doing directly in the main application software.

I also use wago PFC for several functions which mostly involve modbus and regular ladder logic programming. Exploring E!cockpit libraries I came across WagoAppHTTP and grow the idea to implement the API functionality within my wago program.

After different attempts on configuring the function block FbHTTPs\_GET I have given up as not really capable of understanding how to use it.

My real intention would be to trigger functions on the external software API with FbHTTPs\_POST sending my http commands and receive feedback sent out by the API with FbHTTPs\_GET

I would need sending 3 different commands and receive 6 different feedback types.

To send [https://172.17.1.249:55756/Acs/Api/TriggerFacade/ActivateDeactivateTrigger?{“triggerName”:“D1Unlock”,“deactivateAfterSeconds”:“5”}](https://172.17.1.249:55756/Acs/Api/TriggerFacade/ActivateDeactivateTrigger?%7b%22triggerName%22:%22D1Unlock%22,%22deactivateAfterSeconds%22:%225%22%7d)

To receive

[http://172.17.1.200/unlocked/post.php](http://172.17.1.200/unlocked/post.php)

this above is actually something I can write from the external software in plain text and the http command sent is also plain text type.

172.17.1.249 is the API address and 172.17.1.200 is my PFC100

I would need someone to help me configuring the variables necessary for the blocks or even an example of an already configured function block with all needed variables. Something which I can explore to understand what I am doing wrong.

Is here anyone who regularly uses the blocks and knows if I could get the PFC100 to receive and send these commands to then make them variables for my program?

Thanks for you help

---

<div class="post-metadata">

**Author:** ![WagoKurt](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagokurt/32/11_2.png) [@WagoKurt](https://www.wago.community/u/WagoKurt)\
**Post date:** [December 5, 2023, 6:13pm UTC](https://www.wago.community/t/how-to-use-wagoapphttp-library-if-never-used-before/712/2 "2023-12-05T18:13:31Z")

</div>

Curl or WagoAppHTTP libraries in Codesys do work with REST API’s. Other ways are to use NodeRED for the communications and pass data between NR and C3.5, or do everything in NR. The best option depends on your application requirements.

---

<div class="post-metadata">

**Author:** ![quenorha](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/quenorha/32/429_2.png) [@quenorha](https://www.wago.community/u/quenorha)\
**Post date:** [December 6, 2023, 8:30am UTC](https://www.wago.community/t/how-to-use-wagoapphttp-library-if-never-used-before/712/3 "2023-12-06T08:30:42Z")

</div>

Take a look to this topic : [E!cockpit JSON string, sort data - #5 by espenbo](https://www.wago.community/t/e-cockpit-json-string-sort-data/294/5)

There’s a great example of how to use WagoAppHttp and WagoAppJSON in order to communication with an REST API (here to get electricity prices in Norway).

---

<div class="post-metadata">

**Author:** ![WagoDamRud](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagodamrud/32/258_2.png) [@WagoDamRud](https://www.wago.community/u/WagoDamRud)\
**Post date:** [December 19, 2023, 4:51pm UTC](https://www.wago.community/t/how-to-use-wagoapphttp-library-if-never-used-before/712/4 "2023-12-19T16:51:17Z")

</div>

Ok, lets summarize:

To send request you can use _ **WagoAppHTTP** _ with _ **WagoAppJSON** _ as a JSON parser.  
I prefer to send requests with _ **WagoAppHTTP.FbHTTP\_Client\_Curl** _.  
Btw its better start with **Postman** and check if requests are ok. There you can find on the right side “Code Snippets” where you can clearly find which part of request should be placed in body and which in header.  
If you connect to the linux console, you can test curl requests copied from Postman and check the results.

**HTTP server**  
You can add you webpage with php to _/var/www/_ and create some php/js functions to pass data to the runtime (file, mqtt, shared memory, modbus, nosql etc). You can do it with PFC100.

With PFC200 you can use Docker containers with NodeRED, NodeJS, Python etc, to create HTTP server and pass requests to runtime.
