Why can't I return Json. It is underlined and does not exist in the current context.
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Results;
using System.Web.Mvc;
//class and namespace detail removed to keep this post short
public async Task<IHttpActionResult> Post(string url, StringContent data, Dictionary<string, string> headers)
{
using (var client = new HttpClient())
{
var response = await client.PostAsync(url, data);
var result = await response.Content.ReadAsStringAsync();
//the line below is the error********
return Json(new { HttpStatusCode = HttpStatusCode.OK });
}
}
I also tried install-package System.Json and this didn't help.
I'm aware there are probably other things wrong, the code has never worked as I started it an hour ago but I can't understand why Json is not recognized
This is from within a class library (if it matters)