$url = 'https://example.com/api'; $data = array('name' => 'John', 'email' => 'john@example.com'); $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data), ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context);In this example, we are sending data to the specified API URL through a POST request with the name and email fields being populated with the values 'John' and 'john@example.com'. The code uses the "file_get_contents" function with a stream context that specifies the HTTP method as POST and includes the data that we want to send as the content of the request. The package/library used in this code example is the PHP HTTP context library.