Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6633821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:51:28+00:00 2026-05-25T22:51:28+00:00

I want my request to look and have this effect in the rails server:

  • 0

I want my request to look and have this effect in the rails server:

Started POST "/users/sign_in" for 127.0.0.1 at 2011-08-21 16:22:09
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"mBzfQ73jtZ9rlj01+RCSs6mJoViFQZuRbwunQiX57oU=", "user"=>{"email"=>"a@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."email" = 'a@gmail.com' LIMIT 1
(0.4ms)  UPDATE "users" SET "last_sign_in_at" = '2011-08-21 23:18:50.886178', "current_sign_in_at" = '2011-08-21 23:22:09.698853', "sign_in_count" = 7, "updated_at" = '2011-08-21 23:22:09.699635' WHERE "users"."id" = 1
Redirected to http://localhost:3000/user
Completed 302 Found in 206ms

BUT my request looks something like this:

Started POST "/users/sign_in" for 127.0.0.1 at 2011-08-21 16:19:56
Processing by Devise::SessionsController#create as HTML
Parameters: {"commit"=>"Sign in", "password"=>"[FILTERED]", "email"=>"a@gmail.com", "remember_me"=>"1", "session"=>{"commit"=>"Sign in", "password"=>"[FILTERED]", "email"=>"a@gmail.com", "remember_me"=>"1", "action"=>"create", "controller"=>"devise/sessions"}}
WARNING: Can't verify CSRF token authenticity
Completed   in 1ms
Processing by Devise::SessionsController#new as HTML
Parameters: {"commit"=>"Sign in", "password"=>"[FILTERED]", "email"=>"a@gmail.com", "remember_me"=>"1", "session"=>{"commit"=>"Sign in", "password"=>"[FILTERED]", "email"=>"a@gmail.com", "remember_me"=>"1"}}
WARNING: Can't verify CSRF token authenticity
Rendered /Users/hdj/.rvm/gems/ruby-1.9.2-p290@rails31/gems/devise-1.4.2/app/views/devise/shared/_links.erb (1.6ms)
Rendered /Users/hdj/.rvm/gems/ruby-1.9.2-p290@rails31/gems/devise-1.4.2/app/views/devise/sessions/new.html.erb within layouts/application (25.4ms)
Completed 200 OK in 162ms (Views: 94.0ms | ActiveRecord: 0.9ms)

which im sure doesnt log me in. The cocoa obj C code im using is this:

NSString *urlString = @"http://localhost:3000/users/sign_in";
NSDictionary *thestuff = [NSDictionary dictionaryWithObjectsAndKeys:
                          @"a@gmail.com", @"email", 
                          @"123456", @"password",
                          @"1",@"remember_me",
                          @"Sign in", @"commit",nil];
NSString *tojson = [thestuff JSONRepresentation];
//NSLog(@"%@        %@", thestuff, tojson);
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:urlString]];
[request appendPostData:[tojson dataUsingEncoding:NSUTF8StringEncoding]];
[request addRequestHeader:@"Content-Type" value:@"application/json"];

[request startSynchronous];

Im using synchronous simply because i need the user to be logged in before i move on to the next view. Another thing is that i am not sure how to send the username and password titled as email and password as you can see from the request. So im using a json form.
Essentially I would like to know how I can change this code to have the desired result. Also, is there a way to send the data in HTML form instead of using the json as I have used here?
I would really appreciate help here and if you need more code, Id be happy to provide it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:51:29+00:00Added an answer on May 25, 2026 at 10:51 pm

    You need this after you created the ASIHTTPRequest!

    [request addRequestHeader:@"Content-Type" value:@"application/json"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a request logging DelegatingHandler using the details in this blog post
Really simple request. I want my url to look like: http://localhost/movie/72105 instead of this
I am working with rails 3.2 and want to request some services from http://api.de-captcher.com/
For example in some cases after POST or GET request I want to redirect
I want to send Ajax request to controller, I make like this in the
I want to send a request to another server from my servlet and get
I have this program that I want other processes to be able to call
first I want to say that I hope this doesn't look like I am
I have a list of python dictionaries that look like this: sandwiches = [
I have this route that let me build custom url for users like /thisismyname,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.