Typescript 如何使用angular 2+;通过get方法传递实体;?
我的get方法Api是Typescript 如何使用angular 2+;通过get方法传递实体;?,typescript,angular6,angular5,Typescript,Angular6,Angular5,我的get方法Api是”http://abc/abc“ 实际上,get方法包含的类似于,get(url,options),只有两个参数 但在我的情况下,我必须用这个通过尸体。。 身体就像 { "startIndex":"1", "count":"150", "groupBy":"product", "searchTerm":"product:product1" } 我将如何通过get方法? 有人能帮我吗?信息必须作为参数通过url发送 let startI
”http://abc/abc“
实际上,get方法包含的类似于,get(url,options)
,只有两个参数
但在我的情况下,我必须用这个通过尸体。。
身体就像
{
"startIndex":"1",
"count":"150",
"groupBy":"product",
"searchTerm":"product:product1"
}
我将如何通过get方法?
有人能帮我吗?信息必须作为参数通过url发送
let startIndex="1";
let startIndex="150";
let startIndex="product";
let searchTerm="product:product1";
return this.http.get(`http://abc/abc?startIndex=${startIndex}&count=${count}&groupBy=${groupBy}&searchTerm=${searchTerm}`);
无法在Get响应中传递实体。 发布(URL、选项)并在订阅中获取响应。
这将有动态数据调用如果您需要将
json
传递给api调用,那么为什么不使用POST
方法而不是get?这是否回答了您的问题?