I work on a website (a so-called website) that wants to save some custom data.
Thus, we realized that the best way is to create another site (website) that could handle this. Thus, when a user visits website A, he calls up the website and passes some information through.
The code I use (which I got from this post How to get json from MVC4 C # without javascript and without Ajax )
using (var client = new HttpClient())
{
var responseString = client.GetStringAsync("http://www.example.com/recepticle.aspx?withQueryString=true");
}
The fact is that when I asked this question, a comment was left (now deleted), explaining that I should use WebApi. So what I did ... And here everything goes wrong.
I created a Web Api 2 project and I submit it using Ajax and it works on my localhost. I now deployed in my test environment and realized that I could not achieve what I want because of problems with the cross domain.
Further reading suggests that I can not use json, but should be used jsonp , but , jsonpworks only with getwhere I need post( how to use the type: "POST" in jsonp ajax-call ).
I think I could use get and just ignore the answer, but it seems like a hack ...
Sorry for asking two questions, but I think they are very related.
1: jsonp , get, get (- B)? , A - B jsonp , - B, -B ( , B -A)?
2 ( ): A B javascript/ajax/jquery. CORS -, ajax json?