Comments (6)
any updates here guys?
Please help!
@kevmoo @michalt @cdibona @dberlin
from sync_http.dart.
There's no reproduction steps. No details. No idea how we can help...
from sync_http.dart.
@kevmoo Well, I believe there's no details and/or steps to reproduce the issue because of absence of a template to be filled out whenever someone tries to file a new issue!
I think It was supposed/expected for the issue creator to be guided to create an issue for this repository via a template placeholder that was supposed to exist and being put by the maintainers inside the box of a new issue body.
Since there's lack of guidance (Yet in my POV), even inside the Contributing Guidelines and the Code of Conduct that are being mentioned below this page "as well as in the About Section at the repository's home page", and since there's nothing that relates to creating or reporting an issue even at an external place while being referenced here by this repo, Therefore, I think I have to guess and assume on my own in order to make it more clear for you.
And hopefully this will make sense for you eventually, Otherwise, Kindly let me know how can I meet the expectations.
Hence I am going to use the following template:
Steps to reproduce
- Create a client code that uses this lib. e.g
import 'sync_http.dart';
void main() {
var uri = Uri.parse('https://dog.ceo/api/breeds/image/random');
var request = SyncHttpClient.getUrl(uri);
var response = request.close();
print('Response Status Code: ${response.statusCode}');
print('Response Body: ${response.body}');
}
- Run the code.
Current behaviour (bug)
Response Status Code: 400
Response Body: <html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>cloudflare</center>
</body>
</html>
Expected behaviour (correct)
Response Status Code: 200
Response Body: {"message":"https:\/\/images.dog.ceo\/breeds\/whippet\/n02091134_7375.jpg","status":"success"}
Relevant logs and/or media
Other comment
- 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 is Linux UBUNTU.
- lib
sync_http
version: 0.3.1-dev "Frompubspec.yaml
". - Related issue: Here
Reported by
@ahmadSaeedGoda && @alaashahin1
/label ~Bug
Hope you find this useful.
In addition, if I can provide any further information let me know, would be more than happy to assist!
from sync_http.dart.
I am facing the same issue. Did you find a solution for this?
@kevmoo Well, I believe there's no details and/or steps to reproduce the issue because of absence of a template to be filled out whenever someone tries to file a new issue!
I think It was supposed/expected for the issue creator to be guided to create an issue for this repository via a template placeholder that was supposed to exist and being put by the maintainers inside the box of a new issue body.
Since there's lack of guidance (Yet in my POV), even inside the Contributing Guidelines and the Code of Conduct that are being mentioned below this page "as well as in the About Section at the repository's home page", and since there's nothing that relates to creating or reporting an issue even at an external place while being referenced here by this repo, Therefore, I think I have to guess and assume on my own in order to make it more clear for you. And hopefully this will make sense for you eventually, Otherwise, Kindly let me know how can I meet the expectations.
Hence I am going to use the following template:
Steps to reproduce
- Create a client code that uses this lib. e.g
import 'sync_http.dart'; void main() { var uri = Uri.parse('https://dog.ceo/api/breeds/image/random'); var request = SyncHttpClient.getUrl(uri); var response = request.close(); print('Response Status Code: ${response.statusCode}'); print('Response Body: ${response.body}'); }
- Run the code.
Current behaviour (bug)
Response Status Code: 400 Response Body: <html> <head><title>400 The plain HTTP request was sent to HTTPS port</title></head> <body> <center><h1>400 Bad Request</h1></center> <center>The plain HTTP request was sent to HTTPS port</center> <hr><center>cloudflare</center> </body> </html>
Expected behaviour (correct)
Response Status Code: 200 Response Body: {"message":"https:\/\/images.dog.ceo\/breeds\/whippet\/n02091134_7375.jpg","status":"success"}
Relevant logs and/or media
Other comment
- 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 is Linux UBUNTU.
- lib
sync_http
version: 0.3.1-dev "Frompubspec.yaml
".- Related issue: Here
Reported by
@ahmadSaeedGoda && @alaashahin1
/label ~Bug
Hope you find this useful. In addition, if I can provide any further information let me know, would be more than happy to assist!
I am facing same issue. Did you find a solution to make sync call ?
from sync_http.dart.
I am facing same issue. @kevmoo @ahmadSaeedGoda @alaashahin1 @saurabhgoyal12 @michalt
from sync_http.dart.
Apparently all HTTPS requests would fail. Client sents request as plain http even if specified https:// in url. It is not a matter of localhost or remote.
To whoever looking for a synchonous http call solution, I end up using dart:io with async/await. Below is an example I figured out that works.
import 'dart:io';
import 'dart:convert';
...
var request = await HttpClient().postUrl(url);
request.headers.set('Content-Type', 'application/json');
request.write(body);
var response = await request.close();
if (response.statusCode == 200) {
final responseBody = await response.transform(utf8.decoder).join();
// actions here
}
from sync_http.dart.
Related Issues (8)
- Truncated body in get request
- Dart 2 runtime failure in package HOT 1
- Missing "PATCH" method
- _nativeGetRemotePeer() throws or returns an exception whenever remoteAddress Socket's property getter is called!
- 400 Bad Request for all remote URIs (Only works on localhost)! HOT 1
- tag latest commit with `0.3.1` HOT 1
- Eliminate uses of deprecated CONSTANTS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sync_http.dart.