Commit graph

186 commits

Author SHA1 Message Date
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
def
f2c1b3be13 Fix body in httpclient
- Never append a newline to the body in a HTTP post.
- Pass the entire body to redirections, including multipart data
2015-01-13 18:48:49 +01:00
def
9cf948e0c8 Rename newData() to newMultipartData() 2015-01-05 18:29:17 +01:00
def
e77eec02f3 A few more fixes to httpclient multipart 2015-01-05 01:58:39 +01:00
def
d4955090ae post should work when extra headers don't have trailing newline 2015-01-05 01:55:52 +01:00
def
a90c388f6b Check that p is not nil in format 2015-01-05 01:40:47 +01:00
def
38392d2d03 Add multipart parameter to httpclient's post and postContent 2015-01-05 00:14:53 +01:00
def
c7fac03abe Remove debug messages 2015-01-03 21:53:40 +01:00
def
ee62d56cad Apply #1824 to fix #1823 2015-01-03 17:44:30 +01:00
def
387d598cfb Minor cleanup 2015-01-03 17:40:33 +01:00
def
dd82f0c829 Fix httpclient to properly encode queries (path?queries) 2015-01-03 17:21:54 +01:00
Dominik Picheta
e6245674f2 Fixes #1759.
Caused by not skipping the \c\l with Chunked encoding after the body is parsed.
2014-12-21 22:41:13 +00:00
Will Szumski
2b854849ca removed unused variable from httpclient 2014-12-17 18:51:37 +00:00
Will Szumski
3cfc8877f6 replace deprecated parseUrl with parseUri in httpclient 2014-12-17 18:16:33 +00:00
Will Szumski
7a7fe85f85 switched httpclient to use net module instead of sockets 2014-12-17 17:53:11 +00:00
def
f52fd8785f Fix some deprecation warnings caused by renames 2014-11-13 21:34:46 +01:00
Erik O'Leary
f31c62315f Made 'headers' public 2014-11-06 18:41:21 -06:00
Dominik Picheta
6f155af802 Lots of documentation improvements for asyncdispatch.
Ref #1487.
2014-09-12 22:54:02 +01:00
Dominik Picheta
bd542ebea3 Fixes httpclient SSL issue. Implements unbuffered SSL recv. Ref #1487. 2014-09-06 15:29:38 +01:00
Dominik Picheta
bb1e87ce4d Async SSL support. 2014-08-31 12:55:04 +01:00