ng-zorro / rebirth-http Goto Github PK
View Code? Open in Web Editor NEWJava JPA like HTTP client for Angular. 🍙
License: MIT License
Java JPA like HTTP client for Angular. 🍙
License: MIT License
I saw the comment will get null if TypeScript Interface isn't visible in runtime, but why TypeScript Interface isn't visible? it's werid, I build an ionic app in dev, it works well, but when I build app with a -prod flag it is broken, then get null, so I want to know in which case TypeScript Interface isn't visible?
rebirth-http.ts文件第114行:
if (type.indexOf('json') !== -1) {
当header中拿不到content type的时候这里会报错,建议改成:
if (type && type.indexOf('json') !== -1) {
Hi ...
First of all, Thanks! I really appreciate the time and effort you've put into this module.
While testing your module I realized when using it in production mode the library fails
to work properly.
The error message I am getting is:
invalid assignment to const `n'
This happens when I make a HTTP request and the app stops working afterwards.
I tested this in latest version of angular
Suggestions welcomed! ☕
In my work, I find use @query parameter send a empty character string but don't send this field actually. Through review source code, I find this code ,
.filter(p => args[p.parameterIndex]) // filter out optional parameters
there,
I think url query parameter should support empty character string, so it's can modify to
.filter(p => args[p.parameterIndex] || args[p.parameterIndex] === '') // filter out optional parameters
what do you think of that? @greengerong
hello @greengerong
狼主你好,发现有一个服务作用域的问题:根据您的api在app.component中进行Global interceptors,当我的service是在AppModule中进行provide,或者在其他子模块块中provide,且要将该子模块import到AppModule的话,那没问题;但如果我是用的懒加载方式创建路由,并且有部分service在懒加载模块中声明,那在这里面的service将无法被Rebirth-http包装。
请问这个问题能怎么解决,或者不知道是我还有什么地方没配置好?谢谢
I don't see patch method in api, is there any reason behind it?
您好,我用您这个http之后发现请求2次,我用angular自带http,只有一次请求,这是什么情况
Property 'catch' does not exist on type 'Observable'.
@Headers({ 'Content-Type': 'multipart/form-data' }) @POST('/apps') addApk(@Body formData: FormData, @Query('params') params: { version: string, description: string }): Observable<Result<{ id: number, type: string, url: string }>> { return null; }
---service end---
this.service.add(formData, { version : this.formCache.version, description: this.formCache.description }).subscribe( res => { // ... }, err => { // ... } );
--- component end---
when I post a upload request, here's my feedback:
Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found
should I add the bounary by myself ?
rebirth-http 版本 0.1.3
当使用 @get 和 @query 配合使用的时候,@query 声明的对象会出问题!比如下面的伪代码,最后请求的地址是 https://ip:port/page?end=2017-01-01,start 参数没有被整合到 url 中,进 debug 发现是 错误代码位置 的 result 每次都被 ps.set(k, value[k]) 覆盖,导致遍历的时候,result 只会保存最后一次遍历的属性
export class QueryPageRequest {
public start: string;
public end: string;
}
service:
@GET('/page')
queryByPage(@Query('req') req: QueryPageRequest) :Observable<any> {
return null;
}
baseUrl1: https://a.com/api
@POST('article') // https://a.com/api/article
baseUrl2:https://b.com/api/login
@POST('login') // https://b.com/api/login
how to support both baseUrl1 & baseUrl2 ?
this.rebirthHttpProvider
.baseUrl(baseUrl1)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.