· 6 years ago · Oct 16, 2019, 01:56 PM
1
2 $data = array(
3 'JobType' => 'Wedding in September',
4 'JobRole' => 'Bride',
5 'Name' => 'John Doe',
6 'Email' => 'test@gmail.com',
7 'Phone' => '069234543',
8 'EventDate' => '12/12/2016',
9 'the message' => 'This is a dummy message',
10 'How did you find about us' => 'Lorem ipsum',
11 'SecretKey' => $apiKey
12 );
13
14
15 $post_url = "https://example.com/app/webservice/create-lead/{$studioID}";
16
17
18 // post the data to the API
19 $response = wp_remote_post( $post_url, array(
20 'method' => 'POST',
21 'timeout' => 45,
22 'redirection' => 5,
23 'httpversion' => '1.0',
24 'sslverify' => false,
25 'blocking' => true,
26 'body' => $data,
27 )
28 );