# httpGET sample code

**URL:** <https://mangoh.discourse.group/t/httpget-sample-code/1768>\
**Category:** mangOH Red\
**Created:** [July 27, 2018, 4:31pm UTC](https://mangoh.discourse.group/t/httpget-sample-code/1768 "2018-07-27T16:31:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tolotech](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tolotech](https://mangoh.discourse.group/u/tolotech)\
**Post date:** [July 27, 2018, 4:31pm UTC](https://mangoh.discourse.group/t/httpget-sample-code/1768/1 "2018-07-27T16:31:34Z")

</div>

Any working sample code of using http GET-request?

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [July 27, 2018, 4:54pm UTC](https://mangoh.discourse.group/t/httpget-sample-code/1768/2 "2018-07-27T16:54:54Z")

</div>

libcurl provides and example they describe as [Simple https GET](https://curl.haxx.se/libcurl/c/https.html)

There is also a [httpGet sample app](https://github.com/legatoproject/legato-af/tree/master/apps/sample/httpGet) that’s part of Legato.

---

<div class="post-metadata">

**Author:** ![tolotech](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tolotech](https://mangoh.discourse.group/u/tolotech)\
**Post date:** [August 12, 2018, 11:46am UTC](https://mangoh.discourse.group/t/httpget-sample-code/1768/3 "2018-08-12T11:46:06Z")

</div>

Trying to run HttpGet sample gives:  
Jan 6 00:20:39 | supervisor[654]/supervisor T=main | app.c CreateFileLink() 1485 | Could not stat file at ‘/etc/resolv.conf’. No such file or directory  
Jan 6 00:20:39 | supervisor[654]/supervisor T=main | app.c CreateFileLink() 1588 | Failed to create link at ‘/etc/resolv.conf’ in app ‘httpGet’.

Propably I have something wrong with my environment, how to find resolv.conf? ( im using Win DS, module 7702)

---

<div class="post-metadata">

**Author:** ![Madan](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@Madan](https://mangoh.discourse.group/u/Madan)\
**Post date:** [September 17, 2018, 9:28am UTC](https://mangoh.discourse.group/t/httpget-sample-code/1768/4 "2018-09-17T09:28:32Z")

</div>

Hi All,

I need some quick help on this. This app is not working.  
This is the legato version `18.07.0-2-g3d867cd9_8cbd288d69eeddef221f1c21dd15683d_modified` using on WP7608 module.

Actually, it was working earlier. I had developed a POST functionality. Even that is also not working.

Did anyone try this on the recent 18.07.0 release?  
Did something happen on the DataServices in 18.07.0?

Need help urgently. Going for a demo this weekend.  
Here is the log.

`Sep 17 09:12:17 swi-mdm9x28 user.warn Legato: -WRN- | _UNKNOWN_[11718]/framework T=main | LE_FILENAME le_fdMonitor_Create() 672 | FD Monitor object name 'httpGet.httpGetComponent.le_data' truncated to 'httpGet.httpGetComponent.le_dat'. Sep 17 09:12:17 swi-mdm9x28 user.info Legato: INFO | httpGet[11718] | HTTP Get! Sep 17 09:12:17 swi-mdm9x28 user.info Legato: INFO | httpGet[11718]/httpGetComponent T=main | httpGet.c SetTechnologies() 60 | Setting the technologies to use for the data connection. Sep 17 09:12:17 swi-mdm9x28 user.info Legato: INFO | httpGet[11718]/httpGetComponent T=main | httpGet.c SetTechnologies() 67 | Added Wifi as the first technology to use. Sep 17 09:12:17 swi-mdm9x28 user.info Legato: INFO | httpGet[11718]/httpGetComponent T=main | httpGet.c SetTechnologies() 82 | Added Cellular as the second technology to use. Sep 17 09:12:17 swi-mdm9x28 user.info Legato: INFO | httpGet[11718]/httpGetComponent T=main | httpGet.c CheckTechnologies() 97 | Checking the technologies to use for the data connection. Sep 17 09:12:17 swi-mdm9x28 user.info Legato: INFO | httpGet[11718]/httpGetComponent T=main | httpGet.c _httpGetComponent_COMPONENT_INIT() 296 | Requesting connection... Sep 17 09:12:17 swi-mdm9x28 user.info Legato: INFO | httpGet[11718]/httpGetComponent T=main | httpGet.c ConnectData() 144 | Requesting the data connection: 0x10000005. Sep 17 09:12:47 swi-mdm9x28 user.err Legato: =ERR= | httpGet[11718]/httpGetComponent T=main | httpGet.c TimeoutHandler() 203 | Couldn't establish connection after 30 seconds Sep 17 09:12:47 swi-mdm9x28 user.info Legato: INFO | supervisor[655]/supervisor T=main | proc.c proc_SigChildHandler() 2035 | Process 'httpGet' (PID: 11718) has exited with exit code 1. Sep 17 09:12:47 swi-mdm9x28 user.warn Legato: -WRN- | supervisor[655]/supervisor T=main | app.c app_SigChildHandler() 3480 | Process 'httpGet' in app 'httpGet' faulted: Ignored. Sep 17 09:12:47 swi-mdm9x28 user.info Legato: INFO | supervisor[655]/supervisor T=main | apps.c DeactivateAppContainer() 374 | Application 'httpGet' has stopped.`

@dfrey, will you be able to throw some light on this?

Thanks  
Madan
