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 7773577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:09:50+00:00 2026-06-01T17:09:50+00:00

I want to update data in server which runs in REST API. i am

  • 0

I want to update data in server which runs in REST API. i am using RESTKIT from ios device. But i could not find how to use PUT in restkit.

I have to send data like key:”user_id” value:”2″ these format. Can anyone please help me to solve this problem.. 🙁

  • 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-06-01T17:09:51+00:00Added an answer on June 1, 2026 at 5:09 pm

    SOKeyValue.h : serialized object used as parameter for your call.

    #import <Foundation/Foundation.h>
    
    @interface SOKeyValue : NSObject
    @property (nonatomic, retain) NSString* key;
    @property (nonatomic, retain) NSString* value;
    @end
    

    Here’s a simplified code to initialize Restkit :

    /*
     This part of code must be executed only one time in your application
    */
    //To see logs
    RKLogConfigureByName("RestKit/Network", RKLogLevelTrace);
    
    //Init with good domain
    RKObjectManager* manager = [RKObjectManager    objectManagerWithBaseURL:@"http://mydomain.dev/ui/v1"];
    
    //Indicate to use JSON
    [RKObjectManager sharedManager].serializationMIMEType = RKMIMETypeJSON;
    
    //Route path when you call a PUT with SOKeyValue class
    [manager.router routeClass:[SOKeyValue class] toResourcePath:@"/yourpath" forMethod:RKRequestMethodPUT];
    
    //Serialization for SOKeyValue class
    RKObjectMapping* keyvalueSerializationMapping = [RKObjectMapping mappingForClass:[NSMutableDictionary class] ];
    [authSerializationMapping mapAttributes:@"key", @"value", nil];
    [[RKObjectManager sharedManager].mappingProvider setSerializationMapping:keyvalueSerializationMapping  forClass:[SOKeyValue class] ];
    

    Now we can implement a service who use PUT. In the object that will implement the call dont forget the restkit delegate RKObjectLoaderDelegate:

    #import <Foundation/Foundation.h>
    #import <RestKit/RestKit.h>
    #import "SOKeyValue.h"
    @interface MyViewOrMyServiceObject: NSObject <RKObjectLoaderDelegate>
    - (void)putKeyValue;
    - (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects;
    - (void)objectLoader:(RKObjectLoader*)objectLoader didFailWithError:(NSError*)error;
    @end
    

    In your (.m) :

    - (void)putKeyValue 
    {
    
        SOKeyValue *keyvalue = [[SOKeyValue alloc] init];
        keyvalue.key = @"k";
        keyvalue.value = @"2";
        [[RKObjectManager sharedManager] putObject:keyvalue delegate:self];
        [keyvalue release];
    }
    

    You can see status code in your trace, and use callback functions :

    - (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects;
    - (void)objectLoader:(RKObjectLoader*)objectLoader didFailWithError:(NSError*)error;
    

    So i dont have MAC at home, it’s diffcult for help you about the code structure. If you have questions do not hesitate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My customer doesn't want a database but would prefer to update their data in
What I want: Update all new commits from server with my local repository in
I want to update client data with server data and vice-versa. Currently i am
i want to update my sqlite database but i cannot find the way to
I want to update some file in a server, with an automated script and
the program on which I am working gets data from a web service, adds
I am using JEditable jquery plugin to update some data on my webpage. After
I am using Ajax to send query to PHP server, which then run the
I have an Access file on a server which my colleagues will update regularly
I want my flot graph to update it's data on set intervals. I have

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.