1

与えられた

a chunk of books and each book will associated with unique id

シナリオ:

user can order more than one book

目標:

   making an NSMutableURLRequest and send this request to server and let server know which books 
    are being picked 

質問:

  For example, user A will choose 3 books whose id are a, b ,c. How can I send an array 
  containing with these id in the request so that server can know that user A are ordering these books
4

1 に答える 1

1

サーバーが想定している形式によって異なります。たとえば、RESTful を使用している場合は、post または get のいずれかを選択し、それに基づいてクエリを作成する必要があります。restful を使用する場合は、RestKit API を使用し、params プロパティを使用します。(または、基本的な ios api を使用して直接ビルドすることもできます)。データを JSON 形式で送信することもできますが、サーバーはデータの解析方法を認識している必要があります。

于 2012-07-12T02:24:15.277 に答える