Jump to content

please how to get api prestashop in flutter


achref_tdiscount

Recommended Posts

class _HomePageState extends State<HomePage>

{ Future<String> getData () async{

http.Response response = await http.get( ("http://localhost/prestashop/api/products/1?output_format=JSON"),

headers: { "Authorization": basicAuthenticationHeader('EZH8CRBMY6W791QE8Y1IBMZUN9R56A7X', ''),

"Accept" :"application/json", } ); }

@override

Widget build(BuildContext context)

{ return new Scaffold( body: new Center(

child: new RaisedButton(

child: new Text("Get data"),

onPressed: getData, ), ), ); } }

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...