Skip to Content.
Sympa Menu

comanage-users - Re: [comanage-users] API POSTs ignored

Subject: COmanage Users List

List archive

Re: [comanage-users] API POSTs ignored


Chronological Thread 
  • From: Benn Oshrin <>
  • To: Ray Plante <>
  • Cc:
  • Subject: Re: [comanage-users] API POSTs ignored
  • Date: Tue, 20 Jan 2015 16:56:47 -0500

I just tried a POST (using Postman in Chrome) and received a 201 back. Your request looks right. I'm going to guess you're on PHP 5.6 and are running into this issue:

https://bugs.php.net/bug.php?id=66763

It's not clear why that would prevent the request from being processed, but it's a place to start, I guess.

You can also check app/tmp/logs/ to see if there's anything interesting there, as well as your web server and php logs.

Thanks,

-Benn-

On 1/20/15 2:20 AM, Ray Plante wrote:
Hi,

I'm trying out the REST API and I'm having trouble getting POSTS to
work. GET actions to the json interfaces seem to work fine (using
curl), but when try to add objects with a POST, nothing seems to
happen: I get a 200 response, but no changes are made to the database.

For example, here's an adaptation of the POST example in the Technical
Manual
(https://spaces.internet2.edu/display/COmanage/REST+API+Examples) that
I tried:

curl -vk -H 'Content-Type: application/json' -d '{
"RequestType":"Cous", "Version":"1.0", "Cous": [{"Version":"1.0",
"CoId":"1", "Name":"Hackers", "Description":"Hidden genius"}]}' -X
POST -u "user:pass" http://127.0.1.1/registry/cous.json

Here's what comes back:

< HTTP/1.1 200 OK
< Date: Tue, 20 Jan 2015 07:08:25 GMT
< Server: Apache/2.2.14 (Ubuntu)
< Vary: Accept-Encoding
< Content-Length: 406
< Content-Type: text/html; charset=UTF-8
<
{ [data not shown]
* Connection #0 to host 127.0.1.1 left intact
* Closing connection #0
<br />
<b>Deprecated</b>: Automatically populating $HTTP_RAW_POST_DATA is
deprecated and will be removed in a future version. To avoid this
warning set 'always_populate_raw_post_data' to '-1' in php.ini and use
the php://input stream instead. in <b>Unknown</b> on line <b>0</b><br
/>
<br />
<b>Warning</b>: Cannot modify header information - headers already
sent in <b>Unknown</b> on line <b>0</b><br />

I conclude this is not an Auth issue since the username and password
works fine with the GET commands (unless I get the password wrong).
Is there some configuration I missed? Is there some other
authorization I need to do besides adding an API user? Is there a
place to look for error messages?

thanks,
Ray




Archive powered by MHonArc 2.6.16.

Top of Page