Skip to content

Use httplug instead of old adapter #8

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

Merged
merged 3 commits into from
Oct 23, 2015
Merged

Use httplug instead of old adapter #8

merged 3 commits into from
Oct 23, 2015

Conversation

joelwurtz
Copy link
Member

Relink this library to new interface of httplug

Should we rename all "adapter" to client ?

@sagikazarmark
Copy link
Member

Thanks, I will try this out with one of the existing adapters, once it is updated.

Should we rename all "adapter" to client ?

No, I don't think it is necessary. They are still adapters of other, existing clients.

@joelwurtz
Copy link
Member Author

It's currenlty running against https://github.com/joelwurtz/socket-adapter-temp (with the last commit)

@sagikazarmark
Copy link
Member

Ah, cool. Not just cool, awesome.

@joelwurtz
Copy link
Member Author

Actually i was having random errors, i have to force the content length header in tests (to have valid requests) otherwise the php server will throw random 400 bad request (for my library)

@sagikazarmark
Copy link
Member

Hm, what kind of errors?

@joelwurtz
Copy link
Member Author

400 Bad request on the PHP server launched by the script

It is mainly due to my adapter which write body by using a buffer (so i do not write the full request on the same call).
So when the php server read the request it may considered it finish but it is not.

By setting the content-length header we told to the server to wait for X bytes before considering the request finish (which is the correct behavior) the other solution would be to send the request as a chunked one but this is another subject ^^

@sagikazarmark
Copy link
Member

Great. I don't think it is a hack anyway, so I am fine with having this in the tests by default.

sagikazarmark added a commit that referenced this pull request Oct 23, 2015
Use httplug instead of old adapter
@sagikazarmark sagikazarmark merged commit 3d7d889 into php-http:master Oct 23, 2015
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.

2 participants