Skip to content

Fixes for PUT #2

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 2 commits into from
Jul 6, 2017
Merged

Fixes for PUT #2

merged 2 commits into from
Jul 6, 2017

Conversation

mikaelgu80
Copy link

Changes made based on tests run against OpenHAB rest API. I've only tried GET and PUT and haven't validated against any other services.
Can't seem to get DHCP working...

@DaKaZ
Copy link
Owner

DaKaZ commented Jul 6, 2017

Looks good, thanks!

@DaKaZ DaKaZ merged commit 23bd8dd into DaKaZ:master Jul 6, 2017
@dbudwin
Copy link

dbudwin commented Aug 22, 2017

This merge breaks being able to POST over SSL, I haven't tested POST'ing over non-SSL, or other verbs like GET. If I check out the commit before this merge commit, things work fine. I turned on debug mode and below is my slightly redacted output. I would have created an issue, but there is no issues tab for this repo:

HTTP: connect
Verifiying SSL certificate
SSL certificate matches
HTTP: connected
REQUEST: 

SSL Print: POST /api/devices/info HTTP/1.1
Host: robohome.xyz:443
Connection: close
Content-Length: 74
Content-Type: application/x-www-form-urlencoded
userId=<redacted>&action=turnon&deviceId=<redacted>


END REQUEST
HTTP: call readResponse
HTTP: NON-NULL RESPONSE POINTER: 
HTTP: RESPONSE: 
HTTP: Connect: 1 Available: 0
.........<about 700,000 more dots>.........HTTPS client closed 
HTTP: return readResponse3
HTTP: return readResponse
HTTP: stop client
HTTP: client stopped

Any idea what's going on? Looking at the this commit I wonder if @mikaelgu80 meant to say if (contentType == NULL) instead of if (contentType != NULL. If it should be != I would suggest removing the // default comment since it doesn't happen by default anymore.

Thanks!

@DaKaZ
Copy link
Owner

DaKaZ commented Aug 28, 2017

@mikaelgu80 I just enabled "issues" - sorry about that. You definitely found a bug (which I just patched) but I don think that should have caused your problems unless your server is expecting a certain type of post data and never returning. If you do open up an issue, please post the code you are using to create your rest client and issue the post. 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.

3 participants