I am sending some data (SOAP XML) to an URL . Here is the code part I use:
<br />
Registry::set('log_cut_data', array('soap'));<br />
$response = Http::post("https://api.n11.com/ws/ProductService.wsdl", $post_data, array( 'headers' => array('Content-type: text/xml')))<br />
```<br />
<br />
But I am getting ERROR below:<br />
<br />
```php
<br />
{"response":{"data":null,"header":{"error":"Sistem hatası oluştu","errorType":"SYSTEM"}}}<br />
```<br />
What does this code mean? Why am I getting this?<br />
<br />
"[i]Sistem hatası oluştu[/i]" means "System Fail"<br />
<br />
The system manager who is developer of the system has said to me that I should select content type as application/json at "Hedaer" part. I didn't understand.<br />
<br />
Is it correct usage?:<br />
<br />
$response = Http::post("https://api.n11.com/ws/ProductService.wsdl", $post_data, array( 'headers' => array([b]'Content-type: application/json'[/b])));
Seems odd that they want you to specify json when you're sending xml. Suggest you ask them for a log of what they are receiving and then ask them what they expect to see. Have you tired only giving 2 arguments to Http::post?
Seems odd that they want you to specify json when you're sending xml. Suggest you ask them for a log of what they are receiving and then ask them what they expect to see. Have you tired only giving 2 arguments to Http::post?
[/quote]
Here is an example of the code that I send:
$post_data = '
'.$appAuth.'
345345 bla bla bla bla bla bla bla bla bla 1002583
Again, you're not sending json you're sending XML. And this header is for text/xml versus application/xml. I would go with the text/xml content type.
I would ask them what's wrong with your request. I'd probably comment out your 'log_cut_data' registry setting till you get this working. Then figure out how to filter the log files as you want.
Thank you tbirnseth. I have found the problem. Problem is based on the HTML tags in description field. When I want to send data in descrption, if this field has HTML tags such as or
their system fails. So, the problem is not about the cs cart or Http::post usage.