Hello, I have a webform containing two fields that I would like to save in an external database. I have created a "Remote post" with a php file and configured it. With debugging enabled, I get my information in json. I would like to be able to retrieve them in my php file which is at http://mysite.com/myfile.php

Here's what I get with debugging

Debug: Remote post: Remote post [completed]
Submission state/operation:
completed
Request URL
http://site.com/newsletter/newsletterDataWebform.php
Request method
POST
Request type
json
Request options
json:
  custom: data
  name: Marie
  email: test@test.com
  gdpr: 1
Response status code:
200
Response header:
Date:
  - 'Wed, 24 Jun 2020 14:56:49 GMT'
Server:
  - 'Apache/2.4.29 (Ubuntu)'
Content-Length:
  - '27'
Content-Type:
  - 'text/html; charset=UTF-8'
Response body:
test données du formulaire
Response data:
'test données du formulaire'
Response tokens:
Below tokens can ONLY be used to insert response data into value and hidden elements.
[webform:handler:remote_post:completed]
Message:
Remote post successful!

Thanks a lot for help !

Comments

Mariedbckr created an issue. See original summary.

jrockowitz’s picture

Status: Active » Closed (outdated)
The Webform module's issue queue is for bugs, feature requests, and planning. Please post general support questions to Drupal Answers. You can also ask questions or help answer questions on the #webform channel on Drupal Slack.

The webform module include a remote post handler. I recommend trying to use it before writing custom PHP code.