Writing Dart/Flutter requests without writing a line

curl ‘https://medium.com/_/graphql' \-H ‘authority: medium.com’ \-H ‘apollographql-client-name: lite’ \-H ‘medium-frontend-route: ShowAcctSignIn’ \-H ‘ot-tracer-sampled: true’ \-H ‘ot-tracer-traceid: 217ae668698ea647’ \-H ‘medium-frontend-path: /m/signin’ \-H ‘graphql-operation: SendAcctAuthEmail’ \-H ‘content-type: application/json’ \-H ‘accept: */*’ \-H ‘medium-frontend-app: lite/main-20210224–042709–9740f2358f’ \-H ‘user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 OPR/73.0.3856.396’ \-H ‘apollographql-client-version: main-20210224–042709–9740f2358f’ \-H ‘ot-tracer-spanid: 6d45644d7b9ffcb0’ \-H ‘origin: https://medium.com' \-H ‘sec-fetch-site: same-origin’ \-H ‘sec-fetch-mode: cors’ \-H ‘sec-fetch-dest: empty’ \-H ‘referer: https://medium.com/m/signin' \-H ‘accept-language: en-US,en;q=0.9’ \-H ‘cookie: uid=lo_50b1676ffd8c; sid=1:Wpw9IMaT0hfYLssuUTyUfsQ+vUy+UMrE8AHW+mnNWsdLGx7S57OX2wmqi83OiA5v; optimizelyEndUserId=lo_50b1676ffd8c; _ga=GA1.2.273065020.1604938184; lightstep_guid/lite-web=4d0deddb7f2e444d; lightstep_session_id=339dcdfe6f5b4c49; _parsely_visitor={%22id%22:%22pid=b0b634e9d8628e091f40654ca0862685%22%2C%22session_count%22:6%2C%22last_session_ts%22:1613476823362}; __cfduid=de928934f3680dab70a2c2bc89a2979bd1613755902; __cfruid=df755ce1f89d31c49a4c8638e870bf2741c5854a-1614153532; _gid=GA1.2.1568995504.1614153536; g_state={“i_p”:1614187200289,”i_l”:1}’ \ — data-binary $’{“operationName”:”SendAcctAuthEmail”,”variables”:{“email”:”awejgiwegjiwe@gmail.com”,”operation”:”login”,”redirect”:"https://medium.com/?source=login-------------------------------------","onMobileWeb":false},"query":"mutation SendAcctAuthEmail($email: String\u0021, $redirect: String, $fullName: String, $captchaValue: String, $operation: String, $onMobileWeb: Boolean, $resetPasswordFlow: Boolean) {\\n sendAcctAuthEmail(email: $email, redirect: $redirect, fullName: $fullName, captchaValue: $captchaValue, operation: $operation, onMobileWeb: $onMobileWeb, resetPasswordFlow: $resetPasswordFlow) {\\n … on SusiMethod {\\n value\\n __typename\\n }\\n … on BadRequest {\\n message\\n __typename\\n }\\n … on FailedChallenge {\\n message\\n __typename\\n }\\n … on NotFound {\\n message\\n __typename\\n }\\n __typename\\n }\\n}\\n”}’ \ — compressed
var headers = {‘authority’: ‘medium.com’,‘apollographql-client-name’: ‘lite’,‘medium-frontend-route’: ‘ShowAcctSignIn’,‘ot-tracer-sampled’: ‘true’,‘ot-tracer-traceid’: ‘217ae668698ea647’,‘medium-frontend-path’: ‘/m/signin’,‘graphql-operation’: ‘SendAcctAuthEmail’,‘content-type’: ‘application/json’,‘accept’: ‘*/*’,‘medium-frontend-app’: ‘lite/main-20210224–042709–9740f2358f’,‘user-agent’: ‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 OPR/73.0.3856.396’,‘apollographql-client-version’: ‘main-20210224–042709–9740f2358f’,‘ot-tracer-spanid’: ‘6d45644d7b9ffcb0’,‘origin’: ‘https://medium.com',‘sec-fetch-site’: ‘same-origin’,‘sec-fetch-mode’: ‘cors’,‘sec-fetch-dest’: ‘empty’,‘referer’: ‘https://medium.com/m/signin',‘accept-language’: ‘en-US,en;q=0.9’,‘cookie’: ‘uid=lo_50b1676ffd8c; sid=1:Wpw9IMaT0hfYLssuUTyUfsQ+vUy+UMrE8AHW+mnNWsdLGx7S57OX2wmqi83OiA5v; optimizelyEndUserId=lo_50b1676ffd8c; _ga=GA1.2.273065020.1604938184; lightstep_guid/lite-web=4d0deddb7f2e444d; lightstep_session_id=339dcdfe6f5b4c49; _parsely_visitor={%22id%22:%22pid=b0b634e9d8628e091f40654ca0862685%22%2C%22session_count%22:6%2C%22last_session_ts%22:1613476823362}; __cfduid=de928934f3680dab70a2c2bc89a2979bd1613755902; __cfruid=df755ce1f89d31c49a4c8638e870bf2741c5854a-1614153532; _gid=GA1.2.1568995504.1614153536; g_state={“i_p”:1614187200289,”i_l”:1}’};var request = http.Request(‘POST’, Uri.parse(‘https://medium.com/_/graphql'));request.body = ‘’’{“operationName”:”SendAcctAuthEmail”,”variables”:{“email”:”awejgiwegjiwe@gmail.com”,”operation”:”login”,”redirect”:”https://medium.com/?source=login-------------------------------------","onMobileWeb":false},"query":"mutation SendAcctAuthEmail(\$email: Stringu0021, \$redirect: String, \$fullName: String, \$captchaValue: String, \$operation: String, \$onMobileWeb: Boolean, \$resetPasswordFlow: Boolean) {\\n sendAcctAuthEmail(email: \$email, redirect: \$redirect, fullName: \$fullName, captchaValue: \$captchaValue, operation: \$operation, onMobileWeb: \$onMobileWeb, resetPasswordFlow: \$resetPasswordFlow) {\\n … on SusiMethod {\\n value\\n __typename\\n }\\n … on BadRequest {\\n message\\n __typename\\n }\\n … on FailedChallenge {\\n message\\n __typename\\n }\\n … on NotFound {\\n message\\n __typename\\n }\\n __typename\\n }\\n}\\n”}’’’;request.headers.addAll(headers);http.StreamedResponse response = await request.send();if (response.statusCode == 200) {print(await response.stream.bytesToString());}else {print(response.reasonPhrase);}

We are a team of rock-star developers, which provides fully-flexible and powerful products 💥.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store