google / sync_http.dart Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://pub.dev/packages/sync_http
License: BSD 3-Clause "New" or "Revised" License
Home Page: https://pub.dev/packages/sync_http
License: BSD 3-Clause "New" or "Revised" License
This package still uses deprecated Dart 1 SCREAMING CAPS CONSTANTS. These will be removed shortly in Dart 2. This rewriting tool is available for the migration: This tool is available for the migration: https://github.com/dart-lang/dart2_fix .
This package only works fine with localhost servers, but I need to call some remote addresses. can you please assist?
Dart SDK Version (dart --version
): Dart SDK version: 2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "linux_x64"
Operating System: Linux
UBUNTU
.
_nativeGetRemotePeer()
throws exception whenever remoteAddress Socket's property getter is called!
This _nativeGetRemotePeer()
function appears to be a C native function called by Dart code.
This function is called or referenced in sync_socket_patch.dart file that lives in /home/$USER/snap/flutter/common/flutter/bin/cache/dart-sdk/lib/_internal/vm/bin/sync_socket_patch.dart.
Here is the error I get whenever remoteAddress
property gets called:
<type 'OSError' is not a subtype of type 'List<dynamic>' of 'function result'
#0 _NativeSynchronousSocket._nativeGetRemotePeer (dart:io-patch/sync_socket_patch.dart)
#1 _NativeSynchronousSocket.remoteAddress (dart:io-patch/sync_socket_patch.dart:136:18)
#2 _RawSynchronousSocket.remoteAddress (dart:io-patch/sync_socket_patch.dart:28:48)
#3 _RawSynchronousSocket.Eval ()
#4 _RawSynchronousSocket.Eval ()
#5 new SyncHttpClientResponse.processLine (package:sync_http/src/sync_http.dart:403:9)
#6 _LineDecoder._process (package:sync_http/src/line_decoder.dart:45:16)
#7 _LineDecoder.close (package:sync_http/src/line_decoder.dart:49:19)
#8 new SyncHttpClientResponse (package:sync_http/src/sync_http.dart:422:21)
#9 SyncHttpClientRequest.close (package:sync_http/src/sync_http.dart:104:12)
#10 main (package:sync_http/main.dart:41:26)
#11 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)>
The socket is connected and there is a remote address value when this call occurs .. the values of isClosed
& isClosedRead
& isClosedWrite
properties of the _socket
object as instance of _NativeSynchronousSocket
are both equal to false
.
Would you kindly advise?
Note - we should tag commit 39509d6 with a 0.3.1
tag (for history for the most recent publish).
The client is missing PATCH request.
https://github.com/dart-lang/sync_http/blob/3f5019e506281b491ef40119704f745bf4911afd/lib/src/sync_http.dart#L13-L29
can you please clarify for me?
When performing a get request:
SyncHttpClientRequest getRequest = SyncHttpClient.getUrl(uri);
getRequest.headers.add('cookie', _cookie);
SyncHttpClientResponse getResponse = getRequest.close();
The contents of the returned body gets truncated to around 700 characters.
After checking that the actual amount of returned characters is correct, I modified the socket.readSync(1024); sentence to increase the number of bytes being read.... witch sorted out the problem.
I can provide more details on request.
When running package webdriver tests, see the following error
type 'List<dynamic>' is not a subtype of type 'List<String>' of 'value' where...
type 'List<dynamic>' is not a subtype of type 'List<String>' of 'value' where
List is from dart:core
List is from dart:core
String is from dart:core
dart:collection __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.[]=
/sync_http/lib/src/sync_http.dart 155:19 _SyncHttpClientRequestHeaders.add
package:webdriver/src/sync/command_processor.dart 79:21 SyncHttpCommandProcessor._setUpRequest
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.