Welcome Guest, Not a member yet? Register   Sign In
How to POST XML via Phil Sturgeon's REST library
#3

[eluser]smilie[/eluser]
Have you installed RESTFul api in your CI?

I do not use XML, but I do belive it is pretty much same as sending Json. I do it as follows:

Code:
# In controller, I load (installed) library;
# I have also added REST_SERVER (which is address of receiving controller) in the constants.php; I use only 1 controller which sorts out all calls
$this->load->library('rest', array('server' => REST_SERVER));

# Now, REST is loaded, I prepare data which I want to send (in your case, that would be XML):
$data['some']['data'] = 'some data here...';

# And then I call RESTFul API:
$saveOrder = $this->rest->post('saveOrder',$data,'json');

# Whereby:
# 'saveOrder' is the POST function name in the controller
# $data is the data itself
# 'json' is type of data I am sending

So, provide more info where are you stuck at Smile

Cheers,
Smilie


Messages In This Thread
How to POST XML via Phil Sturgeon's REST library - by El Forum - 07-07-2010, 10:38 AM
How to POST XML via Phil Sturgeon's REST library - by El Forum - 11-17-2010, 04:28 AM
How to POST XML via Phil Sturgeon's REST library - by El Forum - 11-17-2010, 06:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB