question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

post paramters are sent as request body not post parameters in ios

See original GitHub issue

Bug description: I want to send post parameters but by using body it will send post body not post parameters and i can send get parameters but not post parameters.

To Reproduce:

      <WebView
        animating
        startInLoadingState
        source={{
          uri: 'http://192.168.43.238/test.php',
          method:'POST',
          body:'groupcode=test',
        }}
      />
<?php
var_dump($_POST);

Expected behavior: I’d like to get post parameters with $_POST not in request body with file_get_contents(‘php://input’)

Environment:

  • OS: ios
  • react-native version: 59.9
  • react-native-webview version: 5.8.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

28reactions
kegicommented, Oct 3, 2019

I’ve faced that bug too. Here is a workaround that worked for me :

headers: { 'Content-Type': 'application/x-www-form-urlencoded', }

0reactions
jjcastroc88commented, Jun 10, 2020

@kegi config fix the problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to post parameters in post request ios swift
I'm trying to send these parameters as ...
Read more >
XMLHttpRequest.send() - Web APIs | MDN
send () accepts an optional parameter which lets you specify the request's body; this is primarily used for requests such as PUT ....
Read more >
Building requests | Postman Learning Center
Your requests can send parameters, authorization details, ... Typically you will use body data with PUT , POST , and PATCH requests.
Read more >
HTTP Post Requests in Swift for be… | Apple Developer Forums
I'm trying to code an app, and I'm learning pretty well on the UI side of things, mostly because swiftUI makes that excessively...
Read more >
URLSession GET and POST HTTP Requests in Swift
Create A URLRequest · HTTP Request With Headers · HTTP Request With URL Parameters · POST HTTP Request With JSON Body · Create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found