D
D
Denis Ruchiev2017-10-14 21:46:40
PHP
Denis Ruchiev, 2017-10-14 21:46:40

How to pass php curl xml post request?

In general, such a problem can not send a php request equivalent to

curl -d 'app_id=APP_ID' -d 'sign_data=SIGN_DATA' -d 'data=DATA ' http://exampleapi

the problem is that the two fields app_id, sign_data are text and in the data field there should be xml
, I try something like this ...
$post['app_id'] = 'appid';
$post['sign_data'] = 'signdata';
$post['data'] = '<xml></xml>';

well,
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
tell me where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-10-14
@denis_bardak

For curl, the XML field is plain text. What's the problem then?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question