简体   繁体   中英

PHP -> passing data to ASP's mvc and getting JSON back?

Say I have a ASP.NET-MVC site somewhere that is supposed to take in some data and return a JSON object. Seems to work manually, ie if I type the data into the window and press "send", it return the needed json object.

But how should I do it from PHP ?

Any ideas? Thanks!

Use tool such as fiddler (or FireBug on Firefox) to inspect the HTTP request and simulate the same request in the PHP code.

The ASP.NET MVC site may use anti-forgery token to prevent CSRF attacks - in such case, you don't have much choice but to first make the request to the page, scavenge the token and then generate your actual request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM