# Fetch txt file from Web

**URL:** <https://community.particle.io/t/fetch-txt-file-from-web/3886>\
**Category:** Troubleshooting\
**Created:** [April 12, 2014, 11:47am UTC](https://community.particle.io/t/fetch-txt-file-from-web/3886 "2014-04-12T11:47:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [April 12, 2014, 2:23pm UTC](https://community.particle.io/t/fetch-txt-file-from-web/3886/3 "2014-04-12T14:23:58Z")

</div>

So you need a TCPClient to connect to the server, grab the txt file content and simple output to your printer.

Not too difficult for that matter!

Take a look at this:

> **[Spark Core Http Client Library](https://community.particle.io/t/spark-core-http-client-library/3251/3)**
>
> Thanks @Dave! While adding support for custom HTTP headers today, I noticed that there is an extra character being sent along with the intended string when using the TCP Client. Either the TCP Client is adding an extra character to the beginning...

or

> **[How to open a URL with Spark Core?](https://community.particle.io/t/how-to-open-a-url-with-spark-core/2800/3)**
>
> The code below has been very reliable for me: void sendGetRequest(const char \* server, const char \* url) { if (myTCP.connect(server, 80)) { myTCP.print("GET "); myTCP.print(url); myTCP.println(" HTTP/1.0"); ...

---

_[View the full topic](https://community.particle.io/t/fetch-txt-file-from-web/3886)._
