Questions tagged [flutter-http]

241 questions
1
vote
0 answers

Flutter error: Unhandled Exception: HandshakeException: Handshake error in client

I'm trying to test my flutter app locally, connecting to my API locally. I have that application running on localhost:5000, and this is the code of a simple login form I've created. import 'dart:convert'; import…
OCDAmmo3
  • 15
  • 4
1
vote
1 answer

if i make an API call it returns me with HTML code in flutter

I am using HTTP package for making API requests but when I make a request it returns me with Html response. import 'package:clima/services/location.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; class…
vandit vasa
  • 413
  • 4
  • 20
1
vote
2 answers

Getting error for Flutter http.get('url') parameter It's not accepting Url String

I'm trying to fetch all json data which https://www.thecocktaildb.com/api/json/v1/1/filter.php?c=Cocktail api returns, to use it in my flutter app var api="https://www.thecocktaildb.com/api/json/v1/1/filter.php?c=Cocktail"; var res=await…
1
vote
1 answer

List' is not a subtype of type 'Map. Flutter issue when parsing api response to model

I am trying to hit an API and then store it into the model? The API response is quite lengthy and consists of multiple level key-value pairs. The API I am hitting is https://gharsansar-backend.herokuapp.com/listing/get/all. This returns a list of…
Ankit Shah
  • 1,087
  • 2
  • 15
  • 30
1
vote
2 answers

The operator '+' isn't defined for the type 'Uri'

I have a project whereby I am using the http package to make various http requests. I recently updated the package and I cannot append url links to the end of the base url that I have. Here is the sample code var _url = Uri.parse('url here'); …
Kevnlan
  • 487
  • 2
  • 10
  • 31
1
vote
2 answers

Is there any way to parse html created with javascript in flutter?

I would like to use metadata_fetch package to get the OGP. The implementation of this package uses the html (parse) package. And it worked for most of the web pages. However, there are some web pages, like this one, that cannot be fetched. I think…
Yone
  • 57
  • 1
  • 9
1
vote
0 answers

Flutter http get() 403 status code problem

I'm practicing on making some get requests using flutter's http plugin, and when I make a request to [https://www.pexels.com], I get 403 Status Code. But when I open the target Url with chrome browser It works fine. Is it something that can be…
Martin Wittick
  • 433
  • 1
  • 4
  • 14
1
vote
0 answers

ClientException in io_client.dart

The code below works started giving trouble when the back-end server is switched from HTTP to HTTPS. The back-end application is written in .NET and runs on IIS 10.0 response = await http.post( …
Sukhi
  • 13,261
  • 7
  • 36
  • 53
1
vote
1 answer

Is there a way to store id value from http response which can be accessed from any page?

I'm new to flutter is there a way to store id value from http response which can be accessed from any page ?. When login the response comes with an ID, I needed that id in various pages in flutter. Is it possible to store it and get the scope from…
Ananthakrishna
  • 517
  • 5
  • 24
1
vote
1 answer

Unrecognized functions

I'm trying to execute an http request to a local server that I did, but I'm getting the following I / flutter (28338) error message: Bad state: Insecure HTTP is not allowed by the platform: http: // mylocalip / auth / login, does anyone know how to…
Hiran Júnior
  • 345
  • 2
  • 9
1
vote
1 answer

ASP.Net Core Bearer Authentication + flutter client

I have a problem with Bearer Authentication in ASP.NET Core 3.1 Web Api project. I configured authentication like that: services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { …
1
vote
1 answer

Clarification about provider in Flutter - How to save data

I'm new to Flutter and I'm spending some time about provider patter, I'm a PHP guy so I have a basic knowledge about it works, especially in Laravel framework. For me a provider is something that should manage data, retrive it from a DB, manipulate…
Christian Giupponi
  • 7,408
  • 11
  • 68
  • 113
1
vote
1 answer

How to allow navigate to another page from FutureBuilder in flutter

In The below code, I am making a login screen, in which after doing an API call, so after getting the data I want to navigate to next screen, I am doing navigation from future builder but it's not working. So, Please help. futureBuilder( …
1
vote
2 answers

httpclient post request with application/x-www-form-urlencoded in flutter

I am making post API call function with content type of application/x-www-form-urlencoded. I am unable to pass parameter in the post method. Below is the related function: Future postAPICall(String apiName, Map
Sagar
  • 585
  • 1
  • 9
  • 28
1
vote
1 answer

FormatException randomly occurs while downloading JSON

I'm trying to download json data from a custom API hosted in Heroku, the code works without issues most of the time, but randomly I get this error flutter: FormatException: Unexpected character (at character 1)