Commit Graph

105 Commits

Author SHA1 Message Date
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
Andreas Rumpf
d7a1abd5f7 Merge pull request #4527 from hendi/httpclient-close-sockets
make httpclient close opened Socket on error
2016-07-28 20:54:58 +02:00
Hendrik Richter
4bef9d020d use defer instead of try ... finally 2016-07-28 15:50:34 +02:00
Hendrik Richter
6a2ad716a4 remove superfluous except: raise 2016-07-28 15:37:34 +02:00
Hendrik Richter
b0f1d9f467 make httpclient close opened Socket on error 2016-07-28 11:30:05 +02:00
Ryan Marcus
0ada2aedfa added when() block so that the compiler doesn't try to link SSL methods when SSL isn't available 2016-07-27 17:26:11 -04:00
Ryan Marcus
0a03b18ae9 removed whitespace diffs 2016-07-27 17:08:28 -04:00
Ryan Marcus
56387c61dd added code to send CONNECT request for https requests through proxies, fixes #4520 2016-07-27 17:02:53 -04:00
Hendrik Richter
5c465e260a Fix empty body on HTTP/1.0 connections
HTTP/1.0 does not send `Connection: close`. Thus we read till the end
of the response in order to catch the whole body.
2016-06-16 15:35:57 +02:00
Euan T
06d4716579 Use passed user agent in newAsyncHttpClient
Fixes #4273.
2016-06-05 09:56:16 +01:00
Dominik Picheta
ca7dd345da Fixes #3847. 2016-06-02 19:51:16 +01:00
Dominik Picheta
b33fbedec0 httpclient now uses httpcore.HttpHeaders 2016-06-02 18:40:13 +01:00
Andreas Rumpf
95bb19a579 moved random procs from math to its own module (breaking change) 2016-05-30 16:24:52 +02:00
Konstantin Molchanov
6075bd4231 Stdlib: httpclient: export strtabs added.
When using `httpclient`, viewing HTTP headers is impossible without importing `strtabs`, which is very much _not_ obvious; it's impossible to know without deep diving into the docs.

Dealing with headers is an essential part of working with HTTP in general, so I propose this change. The situation is analogous to this one with `nre` and `options`: https://github.com/nim-lang/Nim/issues/4158
2016-05-28 10:25:36 +04:00
Dominik Picheta
8050f43588 Fixed some warnings in httpclient, net, and openssl. 2016-04-04 21:28:21 +01:00
Dominik Picheta
3762a47cc4 Remove debug echo introduced in #3896. 2016-02-24 00:00:20 +00:00
def
9afe2c1d8f Fix redirection in httpclient (fixes #3895) 2016-02-23 15:18:17 +01:00
Dominik Picheta
bf4c13711a Fixes incorrect Host header when using httpclient with proxy. 2015-12-29 16:25:21 +00:00
Araq
f4bfa076ae updated httpclient to use tables.getOrDefault 2015-10-14 00:41:04 +02:00
Adam Strzelecki
be991ed413 Rename rawsockets module to nativesockets
This change was done to avoid confusion with TCP/IP raw sockets. Native sockets
module represents handling native system low level socket API in general and is
not just limited anyhow to TCP/IP raw sockets.

A stub lib/deprecated/pure/rawsockets.nim module has been added as
compatibility layer for old code using rawsockets, so this change will not
break existing code.
2015-10-03 19:45:41 +02:00
Doran
619ab0bcf0 Include port in host header as expected 2015-09-04 16:10:32 -04:00
jonathonf
9dde0ae3ac Set correct Host in request header
Ensure the correct destination hostname is used in the request, otherwise the request will fail in one of a number of interesting ways when using a proxy.

Fixes https://github.com/nim-lang/Nim/issues/3166
2015-08-01 20:53:37 +01:00
def
e264fa24cd Fix async httpclient post to work without multipart 2015-07-10 00:32:39 +02:00
Bruce Doan
02402d3ffd Implement async post request 2015-07-02 03:07:01 +07:00
Dominik Picheta
c4009c6182 Fixes #2884
Haven't tested this patch but should work.
2015-06-08 23:10:50 +01:00
pdw
cb6f867495 Fixed 'milliseconds' spelling in code and docs 2015-05-15 20:15:12 -05:00
Oleh Prypin
32109a7867 Don't run non-test code when defined(testing) 2015-04-21 14:37:29 +03:00
def
64903e7050 Use ^ instead of - in slices 2015-03-28 00:38:15 +01:00
Dominik Picheta
bab8190b67 Fixes bugs introduced by ee62d56cad. Closes #2227. 2015-03-05 21:18:28 +00:00
Federico Ceratto
657dca5c3b Fix typos 2015-02-15 16:20:32 +00:00
Varriount
0e65df4bbf Added documentation for the new http request procedures. 2015-01-23 22:06:57 -05:00
Varriount
38b7fb94ef Fixes #1962 2015-01-22 16:45:18 -05:00