調用asp.net的Web API有一個Web API控制器:我如何從Android設備
// POST: api/CountriesAPI
[ResponseType(typeof(Country))]
public async Task<IHttpActionResult> PostCountry(Country country)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
db.Countries.Add(country);
await db.SaveChangesAsync();
return CreatedAtRoute("DefaultApi", new { id = country.CountryID }, country);
}
我不知道如何如何從Android的消耗這一點。請幫忙。
請參閱此鏈接。 http://hintdesk.com/how-to-call-asp-net-web-api-service-from-android/ –
一些更多的鏈接爲你http://square.github.io/retrofit/或http:/ /square.github.io/okhttp/或https://developer.android.com/training/volley/index.html – BNK
非常感謝你 –