문제

I am brand new to D programming so please excuse my ignorance. I am trying to create a basic program to connect to a website and download a page or connect to a restful API and download info. Right now all I need to worry about is TCP (streams). I'm using the std.socket library. Unfortunately I can't find much online or in the documentation that illustrates the proper syntax. I've done this in PHP and C++ and understand the concepts, but I could really use some help on syntax. If someone could post an example or a link it would be greatly appreciated!

도움이 되었습니까?

해결책

Check out the htmlget.d sample that comes with your D compiler. You can see it online here.

You can find detailed documentation for the relevant standard library functions on the D website.

However, if you only need to access HTTP, it would be much simpler to use std.net.curl:

import std.net.curl;
string html = get("dlang.org");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top