I want to use services 3 module to create node of a content type in my Drupal 6 website.
I have enabled Services 3 module and configured the Rest Server properly. But when I make a post call to it, the browser converts the POST method into OPTIONS and hence the response that is received is http 411 error. Further more, there is an error in that console about Access-control-allow-origin. This clearly means that this is a CORS issue.
I searched for a way to enable CORS in Drupal 6 and found out that we can enable CORS by adding headers in the .htaccess file. I added the following lines to .htaccess file :
Header set Access-Control-Allow-Origin "*" env=IS_CORS
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
Header add Access-Control-Allow-Headers "x-requested-with"
Is this the correct way to enable CORS in Drupal 6 site?
Thanks in advance. Please try to guide me through this. I am sure many people must have faced this situation, but I am currently not able to find nice solution to this.