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

Added upload support in HTTP #65

Merged
merged 5 commits into from Jun 17, 2012
Merged

Added upload support in HTTP #65

merged 5 commits into from Jun 17, 2012

Conversation

n-studio
Copy link
Contributor

I wrote a little patch to enable uploads with the HTTP wrapper.
I'm a beginner so the code may be a bit dirty, feel free to improve it.

It's inspired from ASI HTTP Request.

How to use:

BW::HTTP.post(url, {:payload => {[name] => [value]}, :files => {[name] => [NSData]}}) do |response|; end

Sorry I haven't written tests, I don't know how to do > .<

I don't know if the code is clean enough… It is inspired from ASI HTTP
Request
@n-studio
Copy link
Contributor Author

Woops, my patch fails when payload is nil and files is not nil

@jimsynz
Copy link
Contributor

jimsynz commented Jun 15, 2012

@mneorr can you provide any comments/guidance on this PR, since the http code is your baby?

@ghost ghost assigned supermarin Jun 15, 2012
@supermarin
Copy link
Contributor

Actually Matt wrote more than me :)

I'm not comfortable in merging it as-is until we have some specs.
Today I'll try to write them and refactor / merge the code.

@n-studio thanks for the contribution!

@supermarin
Copy link
Contributor

Manually embedded the source, the specs are passing.
I'll merge it now, and then refactor / write new specs.

supermarin pushed a commit that referenced this pull request Jun 17, 2012
Added upload support in HTTP
@supermarin supermarin merged commit eff047d into rubymotion-community:1.1 Jun 17, 2012
@n-studio
Copy link
Contributor Author

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants