我正在使用查询字符串参数对 URL 进行 HTTP GET。但它返回 Httpcode 301 并且请求方法从 GET 更改为 OPTIONS。
import { HttpClient ,HttpClientModule} from "@angular/common/http";
@Injectable()
export class PropertyPrefService {
constructor(private http: HttpClient, private configurationService:Configuration) {}
public searchProjects(propFilter:string):any{
return this.http.get(this.configurationService.ApiUrl+Filter).subscribe();
}
}
但是,如果我使用下面的 javascript 简单脚本请求相同的 URL,它会给出预期的结果。