Skip to content

Http post not sending body on iOS #1343

Closed

Description

@tejainece
Map lMap = {"Foo1": "Bar1", "Foo2": "Bar2"};
String lData = JSON.encode(lMap);  

Map lHeaders = {"Content-type": "application/json", "Accept": "application/json"};

http.Response lResp = await http.post(lUrl, body: lData, headers: lHeaders);

The body is empty.

PS: Also missing the cozy network tab in DevTools in chromium.

Activity

  1. abarth commented on Jan 22, 2016

    @abarth
    Contributor
  2. tejainece commented on Jan 22, 2016

    @tejainece
    Author

    Can I get an ETA on this?

  3. eseidelGoogle commented on Jan 22, 2016

    @eseidelGoogle
    Contributor

    Attempting to repro now.

  4. eseidelGoogle commented on Jan 22, 2016

    @eseidelGoogle
    Contributor
  5. eseidelGoogle commented on Jan 22, 2016

    @eseidelGoogle
    Contributor

    Android is complaining with
    android: I/flutter : NetworkService unavailable MojoInternalError: Failed to register the MojoHandle.
    I'm not sure what that means yet. @collinjackson @mpcomplete

  6. eseidelGoogle commented on Jan 22, 2016

    @eseidelGoogle
    Contributor

    So I'm not yet able to get as far as @tejainece did. I wonder if there is a regression on master.

  7. eseidelGoogle commented on Jan 22, 2016

    @eseidelGoogle
    Contributor

    OK. I have it working on Android. Checking iOS. Ran into #1345 (our iOS workflow still needs a ton of work).

  8. eseidelGoogle commented on Jan 22, 2016

    @eseidelGoogle
    Contributor
  9. changed the title [-]Http post not sending body[/-] [+]Http post not sending body on iOS[/+] on Jan 22, 2016
  10. added this to the Hackathon milestone on Jan 22, 2016
  11. 11 remaining items

  12. tejainece commented on Jan 28, 2016

    @tejainece
    Author

    It doesn't work yet. It still sends empty body.

    Maybe I don't have the recent version. I did flutter upgrade. How do I verify it?

  13. chinmaygarde commented on Feb 1, 2016

    @chinmaygarde
    Contributor

    I am not able to reproduce this. Can you try removing the ios/ directory and try flutter ios --init again (after the flutter upgrade that you have already done.)

  14. tejainece commented on Feb 1, 2016

    @tejainece
    Author

    I am testing it on Android, not ios. But sure, I will try that.

  15. tejainece commented on Feb 1, 2016

    @tejainece
    Author

    Working on Android now. Thanks :)

  16. sethladd commented on Feb 1, 2016

    @sethladd
    Contributor

    Cool, thanks for testing!

  17. bennybat50 commented on Nov 1, 2018

    @bennybat50
    final Map<String,dynamic>userData={
          'firstname': _firstNameField,
          'lastname': _lastNameField,
          'display_name': _userNameField,
          'email': _emailField,
          'password': _passwordField
        };
    
        final response = await http.post(url, body:json.encode(userData) );

    I tried sending a post request but its sending an empty body to the server how do i resolve this

  18. eseidelGoogle commented on Nov 2, 2018

    @eseidelGoogle
    Contributor

    @bennybat50 would you be willing to open a new bug with more info (e.g. your flutter version information, etc?) . Thanks!

  19. github-actions commented on Sep 1, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  20. locked as resolved and limited conversation to collaborators on Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions