Skip to content

Something is wrong with MultipartRequest #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
graddotdev opened this issue Mar 3, 2017 · 1 comment
Closed

Something is wrong with MultipartRequest #62

graddotdev opened this issue Mar 3, 2017 · 1 comment

Comments

@graddotdev
Copy link

graddotdev commented Mar 3, 2017

Today I tried make a request to https://api.telegram.org with MultipartRequest, but I did not succeed. Meanwhile, in the postman chrome application it working fine.

What am I doing wrong?

Postman

2017-03-03-113540_902x710_scrot

Http package

I tried run this code:

import 'dart:async';
import 'package:http/http.dart' as http;

Future main() async {
  final url = Uri.parse('https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe');
  final request = new http.MultipartRequest('POST', url);
  request.fields['Name'] = 'John';
  final response = await request.send();
  print(await response.stream.bytesToString());
}

but got the 504 error:

<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.10.0</center>
</body>
</html>
@nex3
Copy link
Member

nex3 commented Mar 6, 2017

This isn't really enough information for me to diagnose the problem, since the server doesn't explain why it's timing out. It's possible this is a symptom of #61, or possibly a proxy issue. If it's the former, this is a duplicate, and if it's the latter the fix will involve configuring your system somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants