Commit graph

186 commits

Author SHA1 Message Date
Andreas Rumpf
aeca422dbe make httpclient work without zero terminators 2018-04-29 07:59:36 +02:00
hlaaf
397e173139 fix #7680 (#7683)
* fix #7680

* Don't send on every HTTP method

* These should be squashed

* 80 column limit
2018-04-26 18:54:14 +01:00
Dominik Picheta
d01b1558a3
Improve progress reporting example. Refs #7693 2018-04-25 22:49:29 +01:00
David Krause
be8ce30acd
copy pastable progress reporting example 2018-04-25 16:06:53 +02:00
Dominik Picheta
992300b300 Call requestAux not request in httpclient. 2018-04-07 18:16:08 +01:00
Araq
710c1184a3 fixes httpclient documentation comment 2018-03-12 08:59:04 +01:00
Dominik Picheta
fb3e460f6d
Improve SSL error message in httpclient. 2018-02-22 10:49:27 +00:00
Dominik Picheta
864467ade3 Merges #7226 manually. 2018-02-19 12:14:45 +00:00
Dominik Picheta
ef19634065 Workaround 'defer' issue in httpclient.downloadFile. Refs #3877. (#7101) 2018-01-18 14:08:35 +01:00
Yuriy Glukhov
cfc0a58417 Fixed crash in ssl httpclient 2018-01-11 23:02:42 +02:00
Ganesh Viswanathan
686a2aaefa Fixes httpclient proxies. Fixes #6685 (#6694)
* Fix for #6685

* Fixed test breakage - SSL call wasn't within when defined(ssl) check
2017-11-07 13:51:09 +00:00
Dominik Picheta
ac67f5eda5 Fixes req w/ both Content-Length & Connection: close headers.
Also closes the socket when connection is closed to ensure
that a new connection is made on any further requests.
2017-10-13 21:14:06 +01:00
Dominik Picheta
b47e448e06 Fixes #6284. 2017-08-28 23:12:36 +01:00
daneb
0a022664d5 Minor formatting 2017-06-13 21:45:18 +02:00
daneb
64cbcec54d Working example to resolve #5863 2017-06-13 21:08:04 +02:00
Ruslan Mustakov
e0059287bb Add 'hostname' param to wrapConnectedSocket 2017-05-04 16:27:08 +07:00
Ruslan Mustakov
ecf278c467 Implement dial, support IPv6 in httpclient (#5763)
* Implement dial, support IPv6 in httpclient

Added ``dial`` procedure to networking modules: ``net``, ``asyncdispatch``,
``asyncnet``. It merges socket creation, address resolution, and connection
into single step. When using ``dial``, you don't have to worry about
IPv4 vs IPv6 problem.

Fixed addrInfo loop in connect to behave properly.
Previously it would stop on first non-immediate failure, instead of
continuing and trying the remaining addresses.

Fixed newAsyncNativeSocket to raise proper error if socket creation
fails.

Fixes: #3811

* Check domain during connect() only on non-Windows

This is how it was in the previous implementation of connect().

* Call 'osLastError' before 'close' in net.dial

* Record osLastError before freeAddrInfo in net.dial

* Add missing docs for 'dial' proc

* Optimize dial to create one FD per domain, add tests

And make async IPv6 servers work on Windows.

* Add IPv6 test to uri module

* Fix getAddrString error handling
2017-05-02 09:25:50 +02:00
Dominik Picheta
5cf31417a6 Fixes #5710. Closes #5711. 2017-04-15 09:03:12 +02:00
Daniil Yarancev
009277856e Fix #5611 2017-04-02 18:52:14 +03:00
Rayner De Los Santos F
d5d975ceef Only remove scheme when there's a TLS request ("https")
If condition, for not removing the scheme when proxied connection isn't a TLS request ("http://...").
2017-03-03 08:47:13 -04:00
Ruslan Mustakov
ef508047bf Ensure default SSL context is always initialized 2017-02-27 16:42:51 +07:00
Araq
b724f46f6f make tests green again 2017-02-26 23:25:50 +01:00
Dominik Picheta
b5de988eda Fix the other withNewLine template. 2017-02-26 12:54:03 +01:00
Dominik Picheta
f9cce32097 Various fixes to FutureStreams based on PR feedback. 2017-02-26 12:52:19 +01:00
Dominik Picheta
912d95a6ea Add small warning in httpclient's onProgressChanged docs. 2017-02-26 11:36:16 +01:00
Araq
45765601e0 fixed premature finishing of httpclient.downloadFile 2017-02-25 17:26:03 +01:00
Dominik Picheta
f9f86899b5 Implement streamed async/sync downloadFile and deprecate old one. 2017-02-11 14:00:53 +01:00
Dominik Picheta
1b4067a81b Implement streamed body reading in httpclient. 2017-02-11 12:43:16 +01:00
Ruslan Mustakov
35d48765fb Use onThreadCreation to set default SSL context for each thread (#5265)
Fixes: #4998
2017-01-23 21:04:14 +01:00
Yuriy Glukhov
2f320fb286 Fixed query and anchor during relative redirection 2017-01-20 12:59:13 +02:00
Yuriy Glukhov
b2237678fb Redirects support in request proc 2017-01-19 17:44:53 +02:00
Dmitry Polienko
4753149227 Implement suggestions from @dom96 2016-11-02 09:19:20 +07:00
Dmitry Polienko
52f4590e98 Don't persist generated headers between requests 2016-10-31 09:46:50 +07:00
Dmitry Polienko
8fb7858291 Reset HttpClient if new URL has different port 2016-10-24 09:42:18 +07:00
Dennis Felsing
f0ed986e0e Update httpclient documentation 2016-10-21 10:53:28 +02:00
Federico Ceratto
7d24656b0a Fix few typos 2016-10-17 13:12:15 +01:00
Alpha Shuro
72b15678a1 Add example for posting json content
i struggled to figure out how to post json content with nim's http client. this is a fundamental capability in many web apps, we don't always need to send data as multipart form data (e.g. when communicating via json apis) so frankly i'm surprised it isn't part of the "post" and "postContent" procs
2016-10-12 13:58:34 +02:00
Dominik Picheta
26c7a76c8a asynchttpserver's Response object's req method uses HttpMethod now.
Fixes #4423.
2016-09-25 00:39:57 +02:00
Dominik Picheta
6a83bc1ff5 HTTP client's request proc no longer slices http method string param. 2016-09-25 00:10:07 +02:00
Dominik Picheta
545e24b8ff Improves httpclient documentation. 2016-09-24 23:02:56 +02:00
Dominik Picheta
cff6ec2155 Implements onProgressChanged callback for httpclient. 2016-09-24 22:58:10 +02:00
Dominik Picheta
ff821eed6a Deprecates old httpclient procedures. 2016-09-24 20:48:28 +02:00
Dominik Picheta
0baef8e6ea Implements getContent and postContent for (Async)HttpClient. 2016-09-24 20:33:00 +02:00
Dominik Picheta
fa9ec7a6b5 Handle redirects in HttpClient's post procs & post test. 2016-09-24 17:50:58 +02:00
Dominik Picheta
cfd187d16e Use distinct range for HttpCode as suggested by @nigredo-tori. 2016-09-19 20:58:27 +02:00
Dominik Picheta
8386476592 Implements proxy support for (Async)HttpClient. Ref #4423.
Fixes #2160.
2016-09-18 22:59:12 +02:00
Dominik Picheta
0c99523ad3 Implements timeouts for synchronous HttpClient. 2016-09-18 19:08:12 +02:00
Dominik Picheta
c4ee18015e Use HttpHeaders in httpclient module. 2016-09-18 18:56:04 +02:00
Dominik Picheta
3ad368f8ca Improvements to httpclient. Refs #4423.
* Adds ability to query HttpCode and compare it with strings.
* Moves HttpMethod to HttpCore module.
* Implements synchronous HttpClient using {.multisync.}.
2016-09-18 18:16:51 +02:00
Dominik Picheta
8e853368c3 Merge branch 'devel' of https://github.com/RyanMarcus/Nim into RyanMarcus-devel 2016-07-30 21:29:00 +02:00