Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大兄弟支不支持上传和预览 #77

Closed
kids-return opened this issue Mar 3, 2017 · 10 comments
Closed

大兄弟支不支持上传和预览 #77

kids-return opened this issue Mar 3, 2017 · 10 comments

Comments

@kids-return
Copy link

类似POSTMAN 里面的
有时接口会报错,返回直接的HTML代码不方便查看报错信息

上传是不是需要自己构建body

@kids-return
Copy link
Author

上传测试

POST {{base_url}}/user/upload
{{headers}}
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"; filename="1.png"
Content-Type: image/png


------WebKitFormBoundary7MA4YWxkTrZu0gW--
< ./1.png

我测试 这样上传不行啊, 有没有查看请求头的方法呢

@Huachao
Copy link
Owner

Huachao commented Mar 3, 2017

@kids-return It's not fully supported to upload file content in multi-part form data now, I will implement this ASAP, thanks for your question. Sorry for the inconvenience.

@Huachao
Copy link
Owner

Huachao commented Mar 7, 2017

@kids-return I have already supported to upload files in multipart/form-data request body in following raw request format:

POST {{base_url}}/user/upload
{{headers}}
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"; filename="1.png"
Content-Type: image/png

------WebKitFormBoundary7MA4YWxkTrZu0gW--
< ./1.png

However, the Upload and Preview is not supported and out of my recent scope, and I will support following format

And I will publish this feature ASAP

@Huachao Huachao closed this as completed Mar 7, 2017
@Huachao
Copy link
Owner

Huachao commented Mar 20, 2017

@kids-return you can try the latest version 0.13.0 to verify 😄

@kids-return
Copy link
Author

@Huachao thanks 大兄弟 有我空试下

@kids-return
Copy link
Author

### 本地上传测试
POST http://127.0.0.1/upload.php?id=1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="text[]"

test
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="text[]"

test2
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"; filename="1.png"
Content-Type: image/png

< ./1.png
------WebKitFormBoundary7MA4YWxkTrZu0gW--

upload.php

<?php
print_r($_GET);
print_r($_POST);
print_r($_FILES);

php file
Local test failed http://127.0.0.1/upload.php?id=1
The server test was successful http://serverIP/upload.php?id=1

@kids-return
Copy link
Author

kids-return commented Mar 21, 2017

Can support the preview on the perfect 👍 :)
I can use this replacement postman

@Huachao
Copy link
Owner

Huachao commented Mar 21, 2017

@kids-return I will consider the preview feature request and do you mean you still fail in local, while succeed in server?

@kids-return
Copy link
Author

@Huachao yes

@Huachao
Copy link
Owner

Huachao commented Mar 21, 2017

@kids-return what do you mean fail, can you provide more details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants