How to make C code to get some content from the Internet?

Suppose I want my C code to retrieve a header from a website like www.example.com

How to do it?

Can I write a program in C?

+3
source share
3 answers

The easiest way is to use an existing HTTP library like libcurl or neon . If you use any framework, it may already have an HTTP client.

+9
source
+5

There are many ways to get the result, but a simple way would be to use the library, as parsing html is often difficult.

You can try to use libxml

There is also libcurl that allows you to simulate a browser.

But trying to parse the html itself will be ... painful.

+1
source

Source: https://habr.com/ru/post/1720566/


All Articles