WARNING: Can't verify CSRF token authenticity
iPhoneからPOSTしたときにこのエラーが出る。
仕方ないのでコントローラに「skip_before_filter」を行った。
class Api::RegistrationsController < ApplicationController # for "WARNING: Can't verify CSRF token authenticity" skip_before_filter :verify_authenticity_token
application_controller.rbのprotect_from_forgeryをコメントアウトする方法もあった。
URL: http://qiita.com/MERON/items/c10f1867077b773c963e
他にも「request」の「addValue」にて行う方法あったが、僕がやってるのは「NSURLRequest」の「request」なので、「addValue」メソッドがなかった。
[request addValue:csrf forHTTPHeaderField:@"X-CSRFToken"];
URL: http://stackoverflow.com/questions/19289587/calling-drupal-webservice-to-post-data-from-objective-c