Questions tagged [flutter-http]

241 questions
0
votes
1 answer

Flutter Error type '_InternalLinkedHashMap' is not a subtype of type 'List'

I'm trying to fetch some posts from my RESTAPI using the provider package and either_options but I'm having some troubles. Every time I'm running the app it gives me this error type '_InternalLinkedHashMap' is not a subtype of type…
0
votes
1 answer

Flutter / Symfony authentication bearer invalid

I'm building from scratch a flutter app for android, which is supposed to request a symfony REST API. Using the http package, I can easily call the login route and store my JWT token using flutter secure storage. But whenever I try and call another…
Brice Le Roux
  • 83
  • 1
  • 8
0
votes
1 answer

The argument type 'Set' can't be assigned to the parameter type 'Map'

I'm trying to create an user authentication system using Auth0 in my Flutter app. The Auth0 REST documentation gave an example of cURL but I didn't find any flutter package which does the job of cURL. So, I used http. Here's the code: …
0
votes
2 answers

How to send files in flutter

I am trying to send files to server with flutter but it return this error: Unhandled Exception: type 'List' is not a subtype of type 'String' in type cast Code I've commented code below for better understanding late List newDoc =…
mafortis
  • 6,750
  • 23
  • 130
  • 288
0
votes
2 answers

Iterating over an array of objects in JSON with Flutter FutureBuilder

I am having trouble trying to iterate over a JSON array of objects from a remote URL using Flutter's FutureBuilder. My goal is to: Fetch JSON data from an API Output the data into a 2 column gridview layout The JSON data is an array of objects(or…
danny471
  • 335
  • 7
  • 17
0
votes
1 answer

How to extract header values from http response?

I am using http post to send some information and get back the response. final response = await http.post( Uri.parse( "some url" ), headers: { …
Sid
  • 378
  • 1
  • 13
0
votes
3 answers

How I use get method with variables in flutter http?

I want to call API but I can't give latitude and longitude as variables.
Shamil Keheliya
  • 358
  • 3
  • 7
0
votes
0 answers

flutter: requesting url shows invalid api

I want the weather report of a current location based on the latitude and longitude. Here is my code for the same: void getData() async{ print("hello"); http.Response response = await…
harini t
  • 11
  • 1
0
votes
0 answers

How can I make an http POST request from dart with authentication?

I'm trying to do a post, to create a user, but in a simple way. I do need to use authentication, so I'm passing the token in the header, as I would do in the GET request. But I'm not sure why I'm receiving the error "400 - Bad Request". import…
emarrero98
  • 11
  • 1
0
votes
1 answer

How to show all the data from Http get request in flutter?

I was working with Http get requests in flutter. I am using jsonplaceholder.typicode.com. I have taken references from the flutter docs but currently, it is showing only the first item. I want to display all the 20 items in the form of cards. Can…
Arijeet
  • 935
  • 5
  • 19
0
votes
1 answer

Why am Returning null for ListItem, since there is an item in backend

I am new to flutter , and i am bulding a listView using ListView.Builder, here i have my model class, and also i did post headers data, but it always returns null, I have tried every possibilty but didn't know that why is happening, any solutin…
0
votes
0 answers

Unhandled Exception: setState() called in constructor:

I know that there are a lot of similar questions but none helped me, that's why I'm posting this one, so please bear with me. My screen is: import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import…
0
votes
1 answer

Error in fetching data from api in flutter

I have to fetch data from this api - https://api.wazirx.com/api/v2/market-status I am getting "xmlhttprequest error" how should I overcome this. Future fetchUserData() async { final response = await http.get(Uri.https('api.wazirx.com',…
0
votes
1 answer

Flutter http.post throw 405 requires POST method

I am trying to log into an API with flutter. Here is the method: var result = await http.post( Uri.https(host, url, queries), headers: { 'Content-Type': 'application/json; charset=UTF-8', }, body: jsonEncode(
0
votes
2 answers

Sending image to server using socket programming in flutter

I have a server-side program in python that is expecting an image and is working fine when tested with a client-side program in python. I want to send image to this server using flutter and I'm failing to do so.. Here's my server-side code import…
ASAD HAMEED
  • 2,296
  • 1
  • 20
  • 36