@@ -360,6 +360,19 @@ class NetworkService {
360360 return response;
361361 }
362362
363+
364+ StoryStore (String accessToken,String content,String type) async {
365+ Map <String , String > headers = {
366+ "Accept" : "application/json" ,
367+ "Authorization" : "Bearer $accessToken " ,
368+ "Content-Type" : "multipart/form-data"
369+ };
370+ var response= await http.post (Uri .parse ("${NetworkService ().baseUrl }/story/store" ),
371+ body: {"type" : type, "content" : content, },headers: headers);
372+ return response;
373+
374+ }
375+
363376 UpdateuserInfo (String accessToken, Object ? body) async {
364377 print (body);
365378
@@ -394,6 +407,25 @@ class NetworkService {
394407 var response = await request.send ();
395408 return response;
396409 }
410+ UploadFileRequestStroy (
411+ String accessToken, String imagePath, String fileType) async {
412+ Map <String , String > headers = {
413+ "Accept" : "application/json" ,
414+ "Authorization" : "Bearer $accessToken " ,
415+ "Content-Type" : "multipart/form-data"
416+ };
417+ var request = http.MultipartRequest (
418+ "POST" , Uri .parse ("${NetworkService ().baseUrl }/storeStory/file" ));
419+ request.files.add (await http.MultipartFile .fromPath ('file' , imagePath));
420+ request.fields['file' ] = imagePath;
421+ request.fields['fileType' ] = fileType;
422+ request.headers.addAll (headers);
423+ print (request.fields);
424+ var response = await request.send ();
425+ return response;
426+ }
427+
428+
397429
398430 Future <void > blockUser ({required int userId}) async {
399431 SharedPreferences prefs = await SharedPreferences .getInstance ();
0 commit comments