开发者

Modify this url to get a json response

开发者 https://www.devze.com 2023-03-15 01:26 出处:网络
How can I modify this url to get a JSON response: https://search.host.com/services/services/meta?id= And when I am using this url to get the result:-

How can I modify this url to get a JSON response:

https://search.host.com/services/services/meta?id=

And when I am using this url to get the result:-

https://search.host.com/rest-services/machine/meta?id=?id=CE90

I am getting XML response, but is there any way that I can modify the above url to get json response.

I was working on some different projects, in that I modified the url like this to get the JSON response:-

http://machine1:8800/ts/select?wt=json&json.wrf=?&q=

So how can I do for the above one.. as I tried doing this way, I am getting 400 bad request. Any suggestions will be appreciated..

As I am not getting any response back from the server, and also I am getting 200 Ok request for this url https://search.host.com/rest-services/machine/meta?id=C011 but no response back. This is below code

var data= 'https://search.host.com/rest-services/machine/meta?id=';
var agile = function() {

                request_meta_info = $.ajax({
                url: search + info.id,
                type: 'GET',
                success: metadata,
                error: metadata

        });
    };

So thought to change the url to get the json response. And when I change the dataType to script then I get the response back but 开发者_运维技巧with the error missing ; before statement. I don't know what I am doing wrong


Are you sure that the web service provides a JSON response? You can't just change a URL to get a different response...


For reference: You are requesting via HTTP, so the proper way to communicate intended response format is with the header "Accept: Application/JSON" (or w/ whatever MIME type you prefer)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号