deploy api proxy thru curl is not working.

Not applicable

Hi,

I am able to deploy proxy thru this url

http://apigee.com/docs/management/apis/post/organizations/%7Borg_name%7D/environments/%7Benv_name%7D...

where as when I tired the same thru curl cmd on my linux machine is not working. here is the curl cmd I used

curl -X POST -u davana.gongadi@abc.com:xxxx https://api.enterprise.apigee.com/v1/organizations/gd_satish/environments/test/pis/weatherapi/revisi...

output of the curl cmd is:

{ "code" : "distribution.DeploymentPathConflict", "message" : "Path /v0/weather conflicts with existing deployment path for revision 4 of the APIProxy weatherapi in organization gd_satish", "contexts" : [ ] }

what did I miss in curl cmd? Can someone please suggest me.

thanks,

Davana

Solved Solved
0 3 817
2 ACCEPTED SOLUTIONS

To override, you need to pass the Content-Type header along with your curl - this will undeploy the previous revision and deploy the current revision

try this,

curl -X POST -u davana.gongadi@abc.com:xxxx https://api.enterprise.apigee.com/v1/organizations/gd_satish/environments/test/pis/weatherapi/revisi... -H 'Content-Type: application/x-www-form-urlencoded'

Thanks

View solution in original post

Not applicable

thanks for quick response Mukundha!.

Passing content-type header worked but we should pass -H next to post instead of at the end.

this curl cmd worked..

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -u davana.gongadi@abc.com:xxxx https://api.enterprise.apigee.com/v1/organizations/gd_satish/environments/test/apis/weatherapi/revis...

Thanks.

View solution in original post

3 REPLIES 3

To override, you need to pass the Content-Type header along with your curl - this will undeploy the previous revision and deploy the current revision

try this,

curl -X POST -u davana.gongadi@abc.com:xxxx https://api.enterprise.apigee.com/v1/organizations/gd_satish/environments/test/pis/weatherapi/revisi... -H 'Content-Type: application/x-www-form-urlencoded'

Thanks

Not applicable

thanks for quick response Mukundha!.

Passing content-type header worked but we should pass -H next to post instead of at the end.

this curl cmd worked..

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -u davana.gongadi@abc.com:xxxx https://api.enterprise.apigee.com/v1/organizations/gd_satish/environments/test/apis/weatherapi/revis...

Thanks.

@Davana -H option should work anywhere. The reason why it is not working at the end is that curl thinks it is part of the URL. If you want to append other curl flags after URL, you will need to enclose the url with quotes to show curl where URL finishes.