Questions tagged [flutter-http]

241 questions
3
votes
1 answer

Flutter Web: Http request is unable to send my header named 'Cookie', is there a way to fix this?

I am calling my API which require a header named 'Cookie' for user auth. I'm using the Http package to make the call and everything is working fine in my Android and iOS app. Now I'm testing my app on web but my API calls are failing. Getting this…
Ashish
  • 73
  • 1
  • 7
3
votes
0 answers

Vimeo video upload fails 1/10 times using Dio package in Flutter

I am using the POST method to upload video file from Flutter App using the Dio package. Vimeo's POST method first generates a link for us to upload the video to. The video is uploaded successfully most of the time. Every once in a while, it fails…
Manas
  • 3,060
  • 4
  • 27
  • 55
3
votes
1 answer

Adding the Authorization header in the flutter code gives back an error response whereas the same request works fine in the postman

I am having a weird error in flutter where just adding an authorization header allows me to have an error. Current Problem I am having, postData(data, apiUrl) async { var fullUrl = _url + apiUrl; var at = await _accessToken; …
3
votes
0 answers

Http Post Unhandled Exception: Invalid argument(s): Invalid request body "Instance of 'Class''

I have a post function that posts a object to server. But I get this error: Unhandled Exception: Invalid argument(s): Invalid request body "Instance of 'UserModel'" Future login(UserModel loginUser) async { String apiUrl = Constants.apiUrl…
Burak Berk
  • 31
  • 2
3
votes
1 answer

In Flutter, make a HTTP request, then depending on response, update the UI or open a new page

I am developing a Flutter app where it acts as a client, connecting to a server via an API. The app makes requests and depending on the response it progresses the state. My question is the following: Can I make a request, and then depending on the…
Nearchos
  • 153
  • 1
  • 11
3
votes
1 answer

HTTP Post request from Flutter Web

I have a function on Google Cloud Functions that I am trying to make a post request to in my Flutter web app. I tested a post request in Python and it worked with the following request: params = {'input_key':'input_value'} headers = {"Content-Type":…
3
votes
1 answer

Flutter http streamedResponse.stream and streamedResponse.sink

I'm learning the third example of Flutter http package, this is the base of the code: https://pub.dev/packages/http When the request is sent via BaseClient.send, only the headers and whatever data has already been written to StreamedRequest.stream…
Shayan
  • 709
  • 1
  • 15
  • 31
3
votes
0 answers

AWS Polly Request from Flutter using sigv4 plugin

I am using https://pub.dev/packages/sigv4 dart package to make a request to AWS Polly. I am getting a 403 error stating {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and…
3
votes
1 answer

get new data with the provider and pull_to_refresh

I'm making a random quote application that I took from the API and returned a json, the API that I use will generate a new quote when it is refreshed I implemented it with DART in a flutter app project, the data sent from the public is captured and…
2
votes
0 answers

Flutter - how to download excel file from a post http response

I'm new to flutter programming and i need to be able to download an excel file from http post request. I have two issues: The response in flutter is null whereas in postman it displays something. The details below [Postman response] The…
Endeavor
  • 21
  • 1
2
votes
4 answers

Which is the best way of api call in flutter

I'm new in flutter development. Recently I heard about Dio and Http packages for api calling. Which is the best one for api calling. If anyone have a better way of api service?? CreateAccountRepository.internal(); static final…
kapil tk
  • 186
  • 10
2
votes
0 answers

Flutter: Should I specify keep-alive in my headers or use an http.Client throughout the app?

An app we have in production has a lot of http requests dealing with authorization, fetching data, and posting data to the backend. It's been reported to us that it load times were lengthy and I figured it was because of the way I was using the http…
Louise
  • 31
  • 4
2
votes
1 answer

How do I access and print the elements in my http Response; Flutter, Dart

I am Logging in to the website using this block of code and printing the status code as well as the response body in the console. void sendLogin() async { var map = { "UserName": _usernameController.text, …
JoshuaaMarkk
  • 123
  • 1
  • 9
2
votes
1 answer

Dart POST Response missing Headers

I guess I'll move this to the top because none of what's been said so far addresses my question. There are some response headers in Postman that I don't get in Dart. I need to access those values in order for my application to work. How do I get…
Grey
  • 331
  • 3
  • 11
2
votes
0 answers

Propagate state between different pages

I've three different MaterialPage. So I use Navigator.push to go from 1 -> 2 -> 3. Now, page 1 make an HTTP request to GET a model that is then used in page 1, 2 and 3. At the end of the process an action on page 3 triggers some modification of the…
Jumpa
  • 4,319
  • 11
  • 52
  • 100
1
2
3
16 17