You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by "anu238 ." <an...@gmail.com> on 2016/01/23 01:19:02 UTC

HTTP Post not allowed

All,
I have a created an entity Users to which I am trying to create record
using olingo 4.0 with the followng command

Request:
/cygdrive/c/curl/curl.exe curl -H "Content-Type: application/json" -X POST
-d '{"Name" : "MS","Id" : "1"}'
http://localhost:8080/identity-service/IdentityService.svc/Users

Response:
{"error":{"code":null,"message":"HTTP method 'POST' not allowed for this
resource."}}


I am getting response that HTTP POST is not allowed for this resource.

I debugged into odata code , I see that
for the below code line:
  uriInfo = new Parser().parseUri(request.getRawODataPath(),
request.getRawQueryPath(), null,
          serviceMetadata.getEdm());
The type of urlinfo is of type "service" which does not allow POST Method
to be called on it.

Anyone knows what could possibly by causing this?

Thanks for your help in advance.
Best,
Anurag

Re: HTTP Post not allowed

Posted by "anu238 ." <an...@gmail.com>.
All,
I found the soln to this problem I will post my patch to this group after
some testing in few days.
Thanks
A

On Friday, January 22, 2016, anu238 . <an...@gmail.com> wrote:

> All,
> I have a created an entity Users to which I am trying to create record
> using olingo 4.0 with the followng command
>
> Request:
> /cygdrive/c/curl/curl.exe curl -H "Content-Type: application/json" -X POST
> -d '{"Name" : "MS","Id" : "1"}'
> http://localhost:8080/identity-service/IdentityService.svc/Users
>
> Response:
> {"error":{"code":null,"message":"HTTP method 'POST' not allowed for this
> resource."}}
>
>
> I am getting response that HTTP POST is not allowed for this resource.
>
> I debugged into odata code , I see that
> for the below code line:
>   uriInfo = new Parser().parseUri(request.getRawODataPath(),
> request.getRawQueryPath(), null,
>           serviceMetadata.getEdm());
> The type of urlinfo is of type "service" which does not allow POST Method
> to be called on it.
>
> Anyone knows what could possibly by causing this?
>
> Thanks for your help in advance.
> Best,
> Anurag
>