Alexander T
655ba271d6
remove cjs assert ( #46 )
...
* remove cjs assert
* change assert signature
* update TS, package-lock.json
2019-01-18 09:53:28 -07:00
Brent Erickson
76cf9f4fe3
Provide early returns in SimpleWebrequests.mapBody
2019-01-17 17:15:38 -07:00
Alexander T
b36d942606
use native forEach in all files instead of _.forEach ( #51 )
2019-01-17 17:10:51 -07:00
Brent Erickson
fb6249faf7
Remove a bunch of un-needed null assertions ( #49 )
2019-01-15 11:38:37 -08:00
Brent Erickson
7be18c8bb0
Periodically check the list of running request to see if any of them … ( #48 )
...
* Periodically check the list of running request to see if any of them have completed & not reported their changed status
We've seen cases of CORS preflight (OPTIONS) requests failing but never calling the onLoad/onError callbacks
Setup a periodic timer to check on the state of running requests & force completion if readyState has changed to 4
* Make the hung request timeout check configurable
2019-01-15 11:22:18 -08:00
Alexander T
a56501b8b7
make SendDataType more specific ( #47 )
2019-01-10 12:00:50 -08:00
Brent Erickson
215fd918f1
Prevent against potential double abort scenario ( #45 )
...
If a request is already aborted, don't send any streamingDownloadProgress data, cancel means we don't care anymore
This prevents a case where two callbacks may both try to cancel the promise (and abort the request) causing an exception
2018-12-13 11:00:31 -08:00
Brent Erickson
8ffc7ffbd9
Prevent a crash when a service return application/json response type but doesn't provide valid json ( #44 )
2018-12-10 13:50:19 -08:00
Tomatipasta
4af2f77f24
#39 : Fix for DOM Exception 12 with Legacy browsers ( #40 )
...
* Fix: responseType=json breaks XHR for Android 4 (Samsung default browser) and Safari prior to 7
* Remove xhr.responseType assignment without try-catch
* Use _.attempt instead of try catch - PR comment
2018-10-23 13:22:26 -07:00
Alexander T
847404e07c
remove useless type casting to any. improve README example. update deps. start to use npm's package-lock feature ( #41 )
2018-10-04 21:45:09 -07:00
David de Regt
4952256f51
0.2.4/0.2.5: Adding handling for when this._options.streamingDownloadProgress results in a cancellation of the task, which clears this._xhr for future handling.
2018-10-02 18:00:04 -07:00
David de Regt
e32a3f151f
0.2.3: Fixing a bug in streamingDownloadProgress
2018-09-27 22:22:31 +02:00
Maria Rekowska
d2f6ea81dc
Check for _aborted before _fire() ( #38 )
...
* Check for _aborted before _fire()
2018-09-20 17:54:06 -07:00
Brent Erickson
e62c7133d1
Fix an assertion if a request with timeout receives 2 callbacks from the Browser/OS. ( #37 )
...
This resulted in _respond being called twice, which (if the correct retry policy was applied) would result in the request being enqueued twice & this two timeout timers were setup.
2018-09-19 18:38:20 -06:00
Alexander T
3a80fcdac8
Fix tests output. Update dependencies ( #36 )
2018-09-17 09:13:10 -06:00
Maria Rekowska
7066837898
Make blockRequestUntil work with MaxSimultaneousRequests and handle e… ( #35 )
...
* Make blockRequestUntil work with MaxSimultaneousRequests and handle errors
2018-08-31 13:35:02 -07:00
David de Regt
43f7349453
0.1.8: Adding support for streaming COMET-style hanging GETs to SimpleWebRequest
2018-08-01 19:13:31 -07:00
Maria Rekowska
ef464603f6
Don't access responseText if responseType is other than text ( #34 )
2018-07-23 09:46:21 -07:00
Maria Rekowska
1b547850fa
Add responseType text
2018-07-16 12:26:24 -07:00
Alexander T
47e62acf77
fix xhr.send incompatible types
2018-07-05 16:19:44 +03:00
Alexander T
37d2fa4697
Remove require imports. Update deps
2018-07-05 16:01:57 +03:00
Alexander T
759603a71e
Fix CI build
2018-05-18 17:00:23 +03:00
Alexander T
733d36e5dc
remove debug info
2018-05-07 18:44:42 +03:00
Alexander T
be8d9134bc
Merge branch 'master' into feature/tests
2018-05-07 17:00:16 +03:00
Alexander T
7336a53474
Feature/add default template parameters to web response ( #24 )
...
* Add Default template parameters to WebResponse
2018-04-24 18:43:31 -07:00
Alexander T
06859b32e9
Merge branch 'master' of https://github.com/Microsoft/SimpleRestClients into feature/tests
2018-04-18 16:06:09 +03:00
Alexander T
7e0f7aa69a
Remove type casts 'as any as number'
2018-04-17 11:34:53 +03:00
Alexander T
d199782677
Add basic ExponentialTime tests
2018-04-16 18:02:21 +03:00
Alexader
8a36fb9d22
Setup tests. Add basic GenericRestClient tests
2018-04-15 14:01:34 +03:00
Alexander T
0511a798a1
Rename _xhrRequestheaders -> _xhrRequestHeaders ( #23 )
2018-04-08 09:21:48 -07:00
Peter Lisy
b93f98df7e
Removed exported const enum
2018-02-21 13:29:02 +01:00
Brent Erickson
b23126266c
Fix a bug that cuased an assert if a request was canceled (via promise chaining) before it was fired
2017-12-22 19:33:27 -07:00
Mark Davis
512e061157
0.1.4: Exposing WebTransportResopnse for the original interfaces (without request bits) to allow transport-agnostic usage of the interfaces. For example, WebSockets do not have the same type of request options or use headers the same way.
2017-11-21 16:59:47 -08:00
Mark Davis
adfb72dbff
0.1.3: Expose request bits from WebResponse. The exact headers are not known until the request is sent, so the caller does not have them (except in simple cases). Also, the request options are useful to return in case the 'caller' is a helper function that creates the request and thus the original caller does not necessarily have that information.
2017-11-16 17:56:02 -08:00
Lukas Weber
f2b85860d7
Resolve succesfully only when XHR.readState is done.
2017-11-14 01:15:56 +01:00
David de Regt
f6ef6c4a8c
0.1.0: Stopping abusing casting things around as <any> and using an explicit non-templated base class for SimpleWebRequest. Cleaning up usages of null and replacing with undefined/optional parameters where necessary. Stopped using lodashMini since babel plugins exist now to do that for us. Lots of other misc cleanup along the way to bring it up to date with newer coding styles on the team.
2017-10-25 22:30:42 -07:00
David de Regt
378a1948d6
Cleaned up SRC for strict null checks, newer Typescript/Tslint, and other compile flags.
2017-10-25 16:13:30 -07:00
Brent Erickson
f3594da143
Fix an issue with double-aborting in RN due to recent behavioural change ( #12 )
...
On React Native, abort requires a call across the bridge making it more async than a typical browser. Since promise resolution is used to determine when a network request is completed (including the abort/cancel case), it's possible for abort() to be called twice OR for a network request success to arrive before the abort is fully processed.
* Don't double count retries if the abort call comes back synchronously
* Bump version for publish
2017-10-11 11:20:41 -07:00
Julien Antony
f6ba178869
Default policy don't retry on canceled call
2017-10-11 08:50:18 +02:00
Julien Antony
37e4b49352
Default policy don't retry on aborted call
2017-10-11 08:47:57 +02:00
Julien Antony
db0313f459
Allow aborted requested to be handled by custom policy
...
- Allow customErrorHandler on aborted call
- Allow retry on aborted call
- Fix: Avoid duplicate call to _respond when the xhr was manually aborted (ie: when timeout is specified)
2017-10-10 10:32:42 +02:00
Mario Santos
bcfb08b7b7
Allowing text/xml & application/xml endpoints response handling
2017-09-06 10:06:30 +02:00
Mark Davis
47ce2aa803
[0.0.18] Better headers flow. Headers are now updated right before firing each attempt instead of using a static set of headers on construction. Use options.overrideGetHeaders for a static set of headers (replacing the deprecated options.headers). ( #7 )
2017-07-20 18:52:45 -07:00
David de Regt
a240997a87
0.0.17: Fixing SimpleWebRequest.setHeader() to work with strictnullchecks
2017-07-13 21:34:02 -07:00
Taavi Kuusik
90703104ff
Added fallback
2017-07-03 13:32:13 -07:00
Taavi Kuusik
29b0f364b2
Changed WebResponse.url to use XHR.responseURL instead of initial request url
2017-06-30 16:49:05 -07:00
David de Regt
ffec8ebb46
Tweaking build scripts and fixing a small issue with Shir's commit
2017-06-26 13:14:44 -07:00
Shir Levkowitz
87408a3d9c
Add formdata
2017-06-26 12:57:22 -04:00
Brent Erickson
6889e8b931
[0.0.14] Update check around empty headers to drop the header instead of asserting ( #4 )
...
Passing empty headers into RN Android no longer crashes, but it does drop the entire header array, so we should still protect against that.
The existing check was incorrectly matching empty string in the assert.
191db90345
2017-06-22 10:12:30 -07:00
Jakub Janovič
8da3fcc2a2
Moving from lodash lib dependency to it's subset ( #3 )
...
* Adding @types/lodash
* replace lodash dependency with sub-dependencies
* Adding tslinting
2017-05-17 14:46:28 -07:00