Re: request assistance resolving a std.net.curl segmentation fault

2023-05-24 Thread anonymouse via Digitalmars-d-learn
On Saturday, 20 May 2023 at 09:20:54 UTC, kdevel wrote: What if the internet connection is not re-established within an reasonable amount of time? What if the resource is no longer available on the server (HTTP eror 404 [1])? If there is an interactive user: Wouldn't it be better have the

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-20 Thread kdevel via Digitalmars-d-learn
On Friday, 19 May 2023 at 23:36:28 UTC, anonymouse wrote: [...] The reason I used a while loop was to detect loss of internet connection and resume the process once the connection is re-established. What if the internet connection is not re-established within an reasonable amount of time?

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
On Friday, 19 May 2023 at 12:40:29 UTC, Danny Arends wrote: On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [SNIP] You're running the whole thing in a while(TRUE) loop, recreating the curl object re-initiating the transfer and file pointer, etc. The

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
On Friday, 19 May 2023 at 12:28:20 UTC, kdevel wrote: On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [...] curl.set(CurlOption.writedata, ); According to [1] this line must read ``` curl.set(CurlOption.writedata, cast (void *)

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
On Friday, 19 May 2023 at 12:28:20 UTC, kdevel wrote: On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [...] curl.set(CurlOption.writedata, ); According to [1] this line must read ``` curl.set(CurlOption.writedata, cast (void *)

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread Danny Arends via Digitalmars-d-learn
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? ```D import std.net.curl: Curl, CurlOption, CurlException; import std.file: exists; import std.stdio: File, writefln; import core.thread: Thread; void downloadFile(string url, string filename) { while

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread kdevel via Digitalmars-d-learn
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [...] curl.set(CurlOption.writedata, ); According to [1] this line must read ``` curl.set(CurlOption.writedata, cast (void *) fp.getFP()); ``` [1]

request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
What am I doing wrong here? ```D import std.net.curl: Curl, CurlOption, CurlException; import std.file: exists; import std.stdio: File, writefln; import core.thread: Thread; void downloadFile(string url, string filename) { while (true) { try { File fp

request assistance resolving a std.net.curl sementation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
What am I doing wrong here? ```D import std.net.curl: Curl, CurlOption, CurlException; import std.file: exists; import std.stdio: File, writefln; import core.thread: Thread; void downloadFile(string url, string filename) { while (true) { try { File fp

std.net.curl and POST-requests with files

2023-05-10 Thread Vindex via Digitalmars-d-learn
The [std.net.curl](https://dlang.org/phobos/std_net_curl.html) module provides these functions: ```d T[] post(T = char, PostUnit)(const(char)[] url, const(PostUnit)[] postData, HTTP conn = HTTP()) T[] post(T = char)(const(char)[] url, string[string] postDict, HTTP conn = HTTP()) ``` How can

Re: POST request with std.net.curl

2021-07-27 Thread bachmeier via Digitalmars-d-learn
On Monday, 26 July 2021 at 19:53:05 UTC, frame wrote: All better the lib could do is to print the text for the status too and the raw payload sent by the server aka error description, if any. That's what I'm proposing. Currently std.net.curl's post function doesn't report all the

Re: POST request with std.net.curl

2021-07-26 Thread frame via Digitalmars-d-learn
On Monday, 26 July 2021 at 14:13:53 UTC, bachmeier wrote: In doubt you can turn on the verbose() method on the HTTP object. That's a modest improvement (for the small number of people that find the option in the docs) but definitely not at the same level of information as the curl CLI. I

Re: POST request with std.net.curl

2021-07-26 Thread bachmeier via Digitalmars-d-learn
On Sunday, 25 July 2021 at 15:44:14 UTC, frame wrote: On Sunday, 25 July 2021 at 13:07:36 UTC, bachmeier wrote: On Friday, 23 July 2021 at 18:11:51 UTC, bachmeier wrote: [...] After all this, it turned out the answer was a simple (but not obvious) typo in the header information. It would be

Re: POST request with std.net.curl

2021-07-25 Thread frame via Digitalmars-d-learn
On Sunday, 25 July 2021 at 13:07:36 UTC, bachmeier wrote: On Friday, 23 July 2021 at 18:11:51 UTC, bachmeier wrote: [...] After all this, it turned out the answer was a simple (but not obvious) typo in the header information. It would be nice to get more information than "HTTP request

Re: POST request with std.net.curl

2021-07-25 Thread bachmeier via Digitalmars-d-learn
On Friday, 23 July 2021 at 18:11:51 UTC, bachmeier wrote: [...] After all this, it turned out the answer was a simple (but not obvious) typo in the header information. It would be nice to get more information than "HTTP request returned status code 400 ()". I don't know if that's possible,

Re: POST request with std.net.curl

2021-07-25 Thread bachmeier via Digitalmars-d-learn
() method for example. I understand, and indeed, that's what's done by the working curl command I posted. I don't know how to translate that into a post request using std.net.curl. The natural thing would be to pass as the second argument the same string I'm sending as the `--data` option to curl

Re: POST request with std.net.curl

2021-07-24 Thread frame via Digitalmars-d-learn
On Friday, 23 July 2021 at 21:25:01 UTC, bachmeier wrote: Authorization is working - it's the same whether I'm doing a GET or POST request. The problem is passing the data. The main problem is that the documentation doesn't explain how to translate a `--data` option into a `post` call. I've

Re: POST request with std.net.curl

2021-07-23 Thread bachmeier via Digitalmars-d-learn
On Friday, 23 July 2021 at 19:59:33 UTC, Ali Çehreli wrote: On 7/23/21 11:11 AM, bachmeier wrote: I'm writing a D program that interacts with the Todoist API using std.net.curl. It's not a problem to do get requests to query tasks, but I cannot find a way to get post to work to create a new

Re: POST request with std.net.curl

2021-07-23 Thread Ali Çehreli via Digitalmars-d-learn
On 7/23/21 11:11 AM, bachmeier wrote: I'm writing a D program that interacts with the Todoist API using std.net.curl. It's not a problem to do get requests to query tasks, but I cannot find a way to get post to work to create a new task. This is a working bash script, where APIKEY is defined

POST request with std.net.curl

2021-07-23 Thread bachmeier via Digitalmars-d-learn
I'm writing a D program that interacts with the Todoist API using std.net.curl. It's not a problem to do get requests to query tasks, but I cannot find a way to get post to work to create a new task. This is a working bash script, where APIKEY is defined elsewhere and $1 and $2 are user

Re: What happened to std.net.curl HTTP execute?

2021-03-25 Thread tastyminerals via Digitalmars-d-learn
On Wednesday, 17 March 2021 at 16:02:58 UTC, tastyminerals wrote: I am using std.net.curl and the following chunk of code in many places: """ http.setPostData(userData, "application/json"); http.addRequestHeader("Accept", "application/json&quo

What happened to std.net.curl HTTP execute?

2021-03-17 Thread tastyminerals via Digitalmars-d-learn
I am using std.net.curl and the following chunk of code in many places: """ http.setPostData(userData, "application/json"); http.addRequestHeader("Accept", "application/json"); http.addRequestHeader("Authorization&quo

Re: std.net.curl and HTTP.responseHeaders

2021-02-04 Thread Vindex via Digitalmars-d-learn
Thank you! For other sites, the first solution somehow worked (I did it following the example from the documentation).

Re: std.net.curl and HTTP.responseHeaders

2021-02-04 Thread Anonymouse via Digitalmars-d-learn
std.stdio, std.net.curl; void main() { enum url = "https://en.wikipedia.org/wiki/Passenger_pigeon;; auto http = HTTP(url); http.perform(); writeln(http.responseHeaders); }

std.net.curl and HTTP.responseHeaders

2021-02-03 Thread Vindex via Digitalmars-d-learn
Header requests to Wikipedia give 405 error for some reason. ``` import std.stdio, std.net.curl; void main() { auto url = "https://en.wikipedia.org/wiki/Passenger_pigeon;; auto http = HTTP(); options(url, http); writeln(http.responseHeaders); } ``` O

Re: std.net.curl : Performance

2020-11-09 Thread Vino via Digitalmars-d-learn
On Monday, 9 November 2020 at 20:57:33 UTC, Daniel Kozak wrote: On Mon, Nov 9, 2020 at 9:50 PM rinfz via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: On Monday, 9 November 2020 at 20:40:59 UTC, rinfz wrote: > On Monday, 9 November 2020 at 19:55:07 UTC, Vino wrote: >> ... >

Re: std.net.curl : Performance

2020-11-09 Thread Daniel Kozak via Digitalmars-d-learn
On Mon, Nov 9, 2020 at 9:50 PM rinfz via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Monday, 9 November 2020 at 20:40:59 UTC, rinfz wrote: > > On Monday, 9 November 2020 at 19:55:07 UTC, Vino wrote: > >> ... > > > > The only curl option you need to set within the loop is

Re: std.net.curl : Performance

2020-11-09 Thread rinfz via Digitalmars-d-learn
On Monday, 9 November 2020 at 20:40:59 UTC, rinfz wrote: On Monday, 9 November 2020 at 19:55:07 UTC, Vino wrote: ... The only curl option you need to set within the loop is the CurlOption.url. So your foreach block should look more like: foreach (...) { string url = chain(apihost,

Re: std.net.curl : Performance

2020-11-09 Thread rinfz via Digitalmars-d-learn
On Monday, 9 November 2020 at 19:55:07 UTC, Vino wrote: ... The only curl option you need to set within the loop is the CurlOption.url. So your foreach block should look more like: foreach (...) { string url = chain(apihost, only(':'), to!string(apiport), apiuri).to!string;

Re: std.net.curl : Performance

2020-11-09 Thread Daniel Kozak via Digitalmars-d-learn
Just delete it On Mon, Nov 9, 2020 at 9:00 PM Vino via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > Hi All, > >Request your help to on how to improve the performance of the > below code. > > import std.conv: to; > import std.net.curl : get,

std.net.curl : Performance

2020-11-09 Thread Vino via Digitalmars-d-learn
Hi All, Request your help to on how to improve the performance of the below code. import std.conv: to; import std.net.curl : get, HTTP, CurlOption; import std.parallelism: parallel; import std.range: chain, only; import std.typecons: Tuple, tuple; void main () { Array!(Tuple!(int,string

Re: std.net.curl get json_encode

2020-10-11 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 11 October 2020 at 08:48:16 UTC, Vino wrote: On Friday, 9 October 2020 at 17:50:16 UTC, Andre Pany wrote: [...] Hi Andre, Thank you very much, now we are able to get the data as expected using jv["Name"], now when we try to print all the returned data with Key and Values as

Re: std.net.curl get json_encode

2020-10-11 Thread Vino via Digitalmars-d-learn
from my mobile, a lot of room for improvements): import std.net.curl, std.stdio; // GET with custom data receivers auto http = HTTP("dlang.org"); http.onReceiveHeader = (in char[] key, in char[] value) { writeln(key, ": ", value); }; ubyte[] content; http.onReceive = (ub

Re: std.net.curl get json_encode

2020-10-09 Thread Andre Pany via Digitalmars-d-learn
sJSONTokenInputRange!Input ` `` datacoll.d(19):All possible candidates are marked as `deprecated` or `@disable` Tip: not satisfied constraints are marked with `>` From, Vino (Writing from my mobile, a lot of room for improvements): import std.net.curl, s

Re: std.net.curl get json_encode

2020-10-09 Thread Vino via Digitalmars-d-learn
On Friday, 9 October 2020 at 05:30:34 UTC, ikod wrote: On Friday, 9 October 2020 at 01:45:37 UTC, Vino wrote: On Friday, 2 October 2020 at 23:20:48 UTC, Imperatorn wrote: On Friday, 2 October 2020 at 21:12:09 UTC, Vino wrote: Hi All, ... auto content = https.perform(); https.shutdown;

Re: std.net.curl get json_encode

2020-10-08 Thread ikod via Digitalmars-d-learn
On Friday, 9 October 2020 at 01:45:37 UTC, Vino wrote: On Friday, 2 October 2020 at 23:20:48 UTC, Imperatorn wrote: On Friday, 2 October 2020 at 21:12:09 UTC, Vino wrote: Hi All, ... auto content = https.perform(); https.shutdown; JSONValue jv = parseJSONValue(content); Maybe JSONValue jv

Re: std.net.curl get json_encode

2020-10-08 Thread Vino via Digitalmars-d-learn
~` datacoll.d(20):All possible candidates are marked as `deprecated` or `@disable` Tip: not satisfied constraints are marked with `>` Code: import std.net.curl, std.conv, std.stdio, stdx.data.json; void main() { auto https = HTTP(); https.handle.set(CurlOption.u

Re: std.net.curl get json_encode

2020-10-02 Thread Imperatorn via Digitalmars-d-learn
On Friday, 2 October 2020 at 21:12:09 UTC, Vino wrote: Hi All, Request your help, the below code is working but we need the output as a json array, in PHP we have json_encode(content), so how to do the same in D, the output is as below, as we need to store this output into database table

Re: std.net.curl get json_encode

2020-10-02 Thread Imperatorn via Digitalmars-d-learn
On Friday, 2 October 2020 at 21:12:09 UTC, Vino wrote: Hi All, Request your help, the below code is working but we need the output as a json array, in PHP we have json_encode(content), so how to do the same in D, the output is as below, as we need to store this output into database table

std.net.curl get json_encode

2020-10-02 Thread Vino via Digitalmars-d-learn
] }, {"id":"2", "hostname":"server2", "pool":"dev", "options":[ {"optionValue":"te...@mail.com,test2"}, {&qu

Re: How to use std.net.curl with specific curl query?

2020-09-04 Thread Italomania via Digitalmars-d-learn
Nice, I have been having this problem for quite a while too. Thanks

Re: How to use std.net.curl with specific curl query?

2020-09-03 Thread tastyminerals via Digitalmars-d-learn
On Thursday, 3 September 2020 at 11:14:14 UTC, tastyminerals wrote: I have a specific curl query that I want to use in a D script via std.net.curl. Here is the query: curl -v -X POST --data-urlencode "username=u...@gmail.net" --data-urlencode "password=12

How to use std.net.curl with specific curl query?

2020-09-03 Thread tastyminerals via Digitalmars-d-learn
I have a specific curl query that I want to use in a D script via std.net.curl. Here is the query: curl -v -X POST --data-urlencode "username=u...@gmail.net" --data-urlencode "password=12345" -H "Content-Type: application/x-www-form-urlen

Re: Does std.net.curl: download have support for callbacks?

2020-06-21 Thread IGotD- via Digitalmars-d-learn
On Thursday, 18 June 2020 at 01:15:00 UTC, dangbinghoo wrote: Don't worry, almost ALL GUI FRAMEWORK in the world IS NOT THREAD SAFE, the wellknow Qt and Gtk, and even morden Android and the java Swing. binghoo dang You can certainly download in another thread in Qt. However, you

Re: Does std.net.curl: download have support for callbacks?

2020-06-17 Thread dangbinghoo via Digitalmars-d-learn
On Thursday, 11 June 2020 at 06:13:59 UTC, adnan338 wrote: On Thursday, 11 June 2020 at 06:05:09 UTC, adnan338 wrote: I would like to set a callback for the `download()` function but I do not seem to find a way to add a callback to the procedure. [...] I have also been told that Gtk is not

Re: Does std.net.curl: download have support for callbacks?

2020-06-11 Thread Cogitri via Digitalmars-d-learn
On Thursday, 11 June 2020 at 06:13:59 UTC, adnan338 wrote: On Thursday, 11 June 2020 at 06:05:09 UTC, adnan338 wrote: I would like to set a callback for the `download()` function but I do not seem to find a way to add a callback to the procedure. [...] I have also been told that Gtk is not

Re: Does std.net.curl: download have support for callbacks?

2020-06-11 Thread evilrat via Digitalmars-d-learn
On Thursday, 11 June 2020 at 06:05:09 UTC, adnan338 wrote: I would like to set a callback for the `download()` function but I do not seem to find a way to add a callback to the procedure. Let's say, for example I have a GtkD Widget called "pb" (short for progressBar). I want to download a

Re: Does std.net.curl: download have support for callbacks?

2020-06-11 Thread adnan338 via Digitalmars-d-learn
On Thursday, 11 June 2020 at 06:05:09 UTC, adnan338 wrote: I would like to set a callback for the `download()` function but I do not seem to find a way to add a callback to the procedure. [...] I have also been told that Gtk is not thread safe. What does this mean and does it effect me on

Does std.net.curl: download have support for callbacks?

2020-06-11 Thread adnan338 via Digitalmars-d-learn
I would like to set a callback for the `download()` function but I do not seem to find a way to add a callback to the procedure. Let's say, for example I have a GtkD Widget called "pb" (short for progressBar). I want to download a file from a url and when done, I want a callback to access

Re: How to do HEAD request in std.net.curl

2020-04-26 Thread data pulverizer via Digitalmars-d-learn
On Sunday, 26 April 2020 at 22:03:33 UTC, data pulverizer wrote: Hi all, I am using std.net.curl and would like to run a HEAD request to find out if a web page exists - I've looked at the documentation and have tried various things that haven't worked. Thanks Never mind, I've got

How to do HEAD request in std.net.curl

2020-04-26 Thread data pulverizer via Digitalmars-d-learn
Hi all, I am using std.net.curl and would like to run a HEAD request to find out if a web page exists - I've looked at the documentation and have tried various things that haven't worked. Thanks

Re: Using std.net.curl

2020-02-29 Thread David Anderson via Digitalmars-d-learn
On Saturday, 29 February 2020 at 07:35:10 UTC, Boris Carvajal wrote: On Saturday, 29 February 2020 at 03:53:37 UTC, David Anderson wrote: I want to capture that text in a variable, but the upload function returns void. How can I get the text returned by the web server to be stored in a

Re: Using std.net.curl

2020-02-28 Thread Boris Carvajal via Digitalmars-d-learn
On Saturday, 29 February 2020 at 03:53:37 UTC, David Anderson wrote: I want to capture that text in a variable, but the upload function returns void. How can I get the text returned by the web server to be stored in a variable? import std; auto updata = read("inputfile"); auto dldata =

Using std.net.curl

2020-02-28 Thread David Anderson via Digitalmars-d-learn
I'm working with std.net.curl. Using curl on the command line I can do this: curl -T file.txt http://localhost:9998/tika and it returns text as a result. When I attempt to do the same thing in D code as follows: import std.net.curl; upload("file.txt", "http://loca

Re: Issues with std.net.curl on Win 10 x64

2019-03-25 Thread Boris Carvajal via Digitalmars-d-learn
not sure if this is a bug or is by design. You could use download() in a parallel foreach, something like this: import std.stdio; import std.parallelism; import std.net.curl; import std.typecons; void main() { auto connections = 3; // 3 parallel downloads defaultPoolThreads(connections - 1

Re: Issues with std.net.curl on Win 10 x64

2019-03-25 Thread Seb via Digitalmars-d-learn
, you could always give requests a shot: https://code.dlang.org/packages/requests It's the unofficial successor of std.net.curl.

Re: Issues with std.net.curl on Win 10 x64

2019-03-25 Thread cptgrok via Digitalmars-d-learn
On Monday, 25 March 2019 at 16:44:12 UTC, Andre Pany wrote: First idea, please switch to x86_64 if possible. This will also be the default of Dub in the next dmd release or the release after. Kind regards Andrew Figured out --arch=x86_64, thanks! Sadly I don't see any change. I'm not

Re: Issues with std.net.curl on Win 10 x64

2019-03-25 Thread Andre Pany via Digitalmars-d-learn
On Monday, 25 March 2019 at 16:25:37 UTC, cptgrok wrote: I need to review syslogs for over 160 systems monthly, and I am trying to write a utility to automate bulk downloads from a custom web service where they are hosted. I need to calculate a date range for the prior month, add start and end

Issues with std.net.curl on Win 10 x64

2019-03-25 Thread cptgrok via Digitalmars-d-learn
system, which is easy, and in a foreach(system; systems) loop in main() I call a function passing the string url in to download and write a log to file. For a small number of systems, it works. My trouble is, using std.net.curl, if I use get(URL) to get the entire text in a single call and write

std.net.curl: how to abort operation

2017-04-15 Thread mab via Digitalmars-d-learn
I want to abort a download, if a condition inside of onReceiveHeader is true. The following code do the job, but it feels very wrong - is there a better/proper way to do such a thing? client.onReceiveHeader = (in char[] key, in char[] value) { if(key == "content-type") { if( -1 ==

std.net.curl application throws an exception

2016-11-27 Thread Erdem via Digitalmars-d-learn
try to compile this program from std.net.curl import std.net.curl, std.stdio; void main() { auto range1 = byLineAsync("www.google.com"); auto range2 = byLineAsync("www.wikipedia.org"); foreach (line; byLineAsync("dlang.org")) writeln(lin

How to access https web page using std.net.curl?

2016-11-20 Thread acbbad via Digitalmars-d-learn
to be a problem with certificates. Can I get the html code of the https site using std.net.curl? Thank you.

Re: std.net.curl and libcurl.so

2016-09-24 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On Saturday, 24 September 2016 at 19:42:11 UTC, Joseph Rushton Wakeling wrote: On Saturday, 24 September 2016 at 19:27:31 UTC, Joseph Rushton Wakeling wrote: Further to earlier remarks: I now think this may be a general problem of LDC 1.0.0 and not a problem of the snap package. I tried

Re: std.net.curl and libcurl.so

2016-09-24 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On Saturday, 24 September 2016 at 19:27:31 UTC, Joseph Rushton Wakeling wrote: Further to earlier remarks: I now think this may be a general problem of LDC 1.0.0 and not a problem of the snap package. I tried building my simple curl-using program using an LDC 1.0.0 build and installed from

Re: std.net.curl and libcurl.so

2016-09-24 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On Saturday, 24 September 2016 at 19:11:52 UTC, Joseph Rushton Wakeling wrote: On Friday, 23 September 2016 at 00:55:43 UTC, Stefan Koch wrote: This suggests that libcurl is loaded. could you compile with -g ? and then post the output ? Further to earlier remarks: I now think this may be a

Re: std.net.curl and libcurl.so

2016-09-24 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
44f971 in std.net.curl.HTTP.perform(std.typecons.Flag!("throwOnError").Flag) () #20 0x0040db01 in std.net.curl._basicHTTP!(char)._basicHTTP(const(char)[], const(void)[], std.net.curl.HTTP) () #21 0x004031ff in std.net.curl.get!(std.net.curl.HTTP, char).get(const(char)[

Re: std.net.curl and libcurl.so

2016-09-22 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 22 September 2016 at 23:19:27 UTC, Joseph Rushton Wakeling wrote: The segfault would suggest to me that either the loading of the library fails or that there's some resource phobos expects to find which it can't access. Can anyone advise what could be going on here? -- Joe

std.net.curl and libcurl.so

2016-09-22 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
Hello all, As some have you may have followed, I've been working on snap-packaging LDC. However, I've run into an issue when it comes to programs that use std.net.curl. Here's a simple example: void main () { import std.net.curl : get; auto website = "

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-16 Thread yawniek via Digitalmars-d-learn
On Tuesday, 16 August 2016 at 10:06:05 UTC, ikod wrote: On Tuesday, 16 August 2016 at 09:16:40 UTC, yawniek wrote: There is common http message parser that used in nginx and nodejs. I think it can be ported from C to D. that is pico, see: https://github.com/nodejs/http-parser/pull/200

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-16 Thread ikod via Digitalmars-d-learn
On Tuesday, 16 August 2016 at 09:16:40 UTC, yawniek wrote: imo things should be modularized. so there should be (fast) protocol parsers first, something like https://github.com/h2o/picohttpparser or https://github.com/seanmonstar/httparse then a very simple eventloop that has abstractions and

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-16 Thread yawniek via Digitalmars-d-learn
imo things should be modularized. so there should be (fast) protocol parsers first, something like https://github.com/h2o/picohttpparser or https://github.com/seanmonstar/httparse then a very simple eventloop that has abstractions and range based interfaces for reading/writing data into

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-15 Thread rikki cattermole via Digitalmars-d-learn
On 16/08/2016 3:35 AM, Seb wrote: On Monday, 15 August 2016 at 15:25:22 UTC, rikki cattermole wrote: On 16/08/2016 3:20 AM, Seb wrote: On Monday, 15 August 2016 at 15:04:29 UTC, rikki cattermole wrote: On 16/08/2016 3:01 AM, Oleg B wrote: As replacement of std.net.curl I found https

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-15 Thread ikod via Digitalmars-d-learn
On Monday, 15 August 2016 at 15:01:13 UTC, Oleg B wrote: Hello. As replacement of std.net.curl I found https://github.com/ikod/dlang-requests. Who know's about this lib? Is this good replacement of std.net.curl? Maybe if I need json and http requests I must fully use vibe for these things

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-15 Thread Lodovico Giaretta via Digitalmars-d-learn
On Monday, 15 August 2016 at 15:01:13 UTC, Oleg B wrote: Hello. In std.xml docs I read that is deprecated, [...] For XML I found this project https://github.com/lodo1995/experimental.xml. Is this really candidate to std, or author just called it as he want? Hi! I'm the developer of that XML

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-15 Thread Seb via Digitalmars-d-learn
On Monday, 15 August 2016 at 15:25:22 UTC, rikki cattermole wrote: On 16/08/2016 3:20 AM, Seb wrote: On Monday, 15 August 2016 at 15:04:29 UTC, rikki cattermole wrote: On 16/08/2016 3:01 AM, Oleg B wrote: As replacement of std.net.curl I found https://github.com/ikod/dlang-requests. Who

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-15 Thread rikki cattermole via Digitalmars-d-learn
On 16/08/2016 3:20 AM, Seb wrote: On Monday, 15 August 2016 at 15:04:29 UTC, rikki cattermole wrote: On 16/08/2016 3:01 AM, Oleg B wrote: As replacement of std.net.curl I found https://github.com/ikod/dlang-requests. Who know's about this lib? Is this good replacement of std.net.curl? Nope

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-15 Thread Seb via Digitalmars-d-learn
On Monday, 15 August 2016 at 15:04:29 UTC, rikki cattermole wrote: On 16/08/2016 3:01 AM, Oleg B wrote: As replacement of std.net.curl I found https://github.com/ikod/dlang-requests. Who know's about this lib? Is this good replacement of std.net.curl? Nope, not a replacement. Why? I like

new XML and JSON libs and replacement of std.net.curl

2016-08-15 Thread Oleg B via Digitalmars-d-learn
Hello. In std.xml docs I read that is deprecated, and std.net.curl can be deprecated too (not remember here I read about std.net.curl). About std.json I read what it's has slow (de)serialization. What I must use at this time? vibe.data.json has evolution https://github.com/s-ludwig

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-15 Thread rikki cattermole via Digitalmars-d-learn
On 16/08/2016 3:01 AM, Oleg B wrote: Hello. In std.xml docs I read that is deprecated, and std.net.curl can be deprecated too (not remember here I read about std.net.curl). About std.json I read what it's has slow (de)serialization. What I must use at this time? vibe.data.json has evolution

Re: Specifying content-type for a POST request using std.net.curl

2016-08-09 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 14:30:21 UTC, Seb wrote: There is also https://github.com/ikod/dlang-requests Which I find in general more intuitive to use ;-) Interesting, I'd not come across that before. Thanks -- I'll give it a glance some time ...

Re: Specifying content-type for a POST request using std.net.curl

2016-08-09 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 14:21:09 UTC, ketmar wrote: http://dpldocs.info/experimental-docs/std.net.curl.HTTP.setPostData.html https://dlang.org/phobos/std_net_curl.html#.HTTP.setPostData reading documentation rox! Yea, mea culpa. I had actually glanced at that but was asking on the

Re: Specifying content-type for a POST request using std.net.curl

2016-08-09 Thread Seb via Digitalmars-d-learn
, because the input data is `void[]` or `ubyte[]` data. Can anyone advise (if it's possible at all) how to specify the content type for the post request body using std.net.curl (or an alternative)? Thanks & best wishes, -- Joe There is also https://github.com/ikod/dlang-requests Whi

Re: Specifying content-type for a POST request using std.net.curl

2016-08-09 Thread ketmar via Digitalmars-d-learn
http://dpldocs.info/experimental-docs/std.net.curl.HTTP.setPostData.html https://dlang.org/phobos/std_net_curl.html#.HTTP.setPostData reading documentation rox!

Specifying content-type for a POST request using std.net.curl

2016-08-09 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
(if it's possible at all) how to specify the content type for the post request body using std.net.curl (or an alternative)? Thanks & best wishes, -- Joe

Re: encoding ISO-8859-1 to UTF-8 in std.net.curl

2016-08-08 Thread ag0aep6g via Digitalmars-d-learn
: ASPSESSIONIDSSCCDASA=KIAPMCMDMPEDHPBJNMGFHMEB; path=/ x-powered-by: ASP.NET Looks like std.net.curl doesn't handle "Charset" correctly. It only works with lowercase "charset". https://github.com/dlang/phobos/pull/4723

Re: encoding ISO-8859-1 to UTF-8 in std.net.curl

2016-08-08 Thread Alexsej via Digitalmars-d-learn
On Monday, 8 August 2016 at 21:11:26 UTC, ag0aep6g wrote: On 08/08/2016 09:57 PM, Alexsej wrote: // content in ISO-8859-1 to UTF-8 encoding but I lose //the Cyrillic "отсутствует или неверно задан параметр" // I get it "отсутствует или неверно задан

Re: encoding ISO-8859-1 to UTF-8 in std.net.curl

2016-08-08 Thread ag0aep6g via Digitalmars-d-learn
On 08/08/2016 11:11 PM, ag0aep6g wrote: Why on earth does transcode only accept immutable characters for input? https://github.com/dlang/phobos/pull/4722

Re: encoding ISO-8859-1 to UTF-8 in std.net.curl

2016-08-08 Thread Alexsej via Digitalmars-d-learn
On Monday, 8 August 2016 at 21:11:26 UTC, ag0aep6g wrote: On 08/08/2016 09:57 PM, Alexsej wrote: // content in ISO-8859-1 to UTF-8 encoding but I lose //the Cyrillic "отсутствует или неверно задан параметр" // I get it "отсутствует или неверно задан

Re: encoding ISO-8859-1 to UTF-8 in std.net.curl

2016-08-08 Thread ag0aep6g via Digitalmars-d-learn
On 08/08/2016 09:57 PM, Alexsej wrote: // content in ISO-8859-1 to UTF-8 encoding but I lose //the Cyrillic "отсутствует или неверно задан параметр" // I get it "отсутствует или неверно задан параметр" // How do I change the encoding to UTF-8

encoding ISO-8859-1 to UTF-8 in std.net.curl

2016-08-08 Thread Alexsej via Digitalmars-d-learn
import std.stdio; import std.net.curl; void main() { string url = "www.site.ru/xml/api.asp"; string data = " 59538 ... ";

How do I properly use std.net.curl onSocketOption hook?

2015-12-11 Thread Or Dahan via Digitalmars-d-learn
Here is my original SO question: http://stackoverflow.com/questions/34218692/how-do-i-properly-set-socket-options-on-std-net-curl any ideas? thx!

Re: std.net.curl

2015-08-17 Thread anonymous via Digitalmars-d-learn
On Monday, 17 August 2015 at 13:13:48 UTC, anonymous wrote: and figured out that the linker is invoked (on my machine) with gcc a.o -o a -m64 -lcurl -L/usr/lib/x86_64-linux-gnu -Xlinker correct (I named the example programm a.d instead of app.d): gcc app.o -o app -m64 -lcurl

Re: std.net.curl

2015-08-17 Thread tired_eyes via Digitalmars-d-learn
On Monday, 17 August 2015 at 13:26:29 UTC, Adam D. Ruppe wrote: On Monday, 17 August 2015 at 13:04:31 UTC, tired_eyes wrote: Error: unrecognized switch '-lcurl' ooh I'm sorry, should have been `dmd -L-lcurl yourprogram.d` Yes, it did the trick.

std.net.curl

2015-08-17 Thread tired_eyes via Digitalmars-d-learn
Hi, I'm trying to compile this trivial example of std.net.curl: // app.d import std.stdio; import std.net.curl; void main() { auto content = get(dlang.org); } Hovewer, dmd app.d spits a whole bunch of strange error messages: /usr/lib64/libphobos2.a(curl.o): In function

Re: std.net.curl

2015-08-17 Thread tired_eyes via Digitalmars-d-learn
On Monday, 17 August 2015 at 12:58:54 UTC, Adam D. Ruppe wrote: On Monday, 17 August 2015 at 12:52:37 UTC, tired_eyes wrote: Hovewer, dmd app.d spits a whole bunch of strange error messages: try dmd -lcurl app.d and see if that helps. Error: unrecognized switch '-lcurl'

Re: std.net.curl

2015-08-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 17 August 2015 at 12:52:37 UTC, tired_eyes wrote: Hovewer, dmd app.d spits a whole bunch of strange error messages: try dmd -lcurl app.d and see if that helps.

Re: std.net.curl

2015-08-17 Thread yawniek via Digitalmars-d-learn
On Monday, 17 August 2015 at 13:04:31 UTC, tired_eyes wrote: On Monday, 17 August 2015 at 12:58:54 UTC, Adam D. Ruppe wrote: On Monday, 17 August 2015 at 12:52:37 UTC, tired_eyes wrote: Hovewer, dmd app.d spits a whole bunch of strange error messages: try dmd -lcurl app.d and see if that

Re: std.net.curl

2015-08-17 Thread anonymous via Digitalmars-d-learn
On Monday, 17 August 2015 at 12:58:54 UTC, Adam D. Ruppe wrote: On Monday, 17 August 2015 at 12:52:37 UTC, tired_eyes wrote: Hovewer, dmd app.d spits a whole bunch of strange error messages: try dmd -lcurl app.d and see if that helps. DMD does not accept -lcurl. From dmd --help:

Re: std.net.curl

2015-08-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 17 August 2015 at 13:04:31 UTC, tired_eyes wrote: Error: unrecognized switch '-lcurl' ooh I'm sorry, should have been `dmd -L-lcurl yourprogram.d`

std.net.curl and PATCH

2015-07-22 Thread Andrea Fontana via Digitalmars-d-learn
It seems that PATCH http method is missing from std.net.curl http methods. No way to use it?

  1   2   >