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

Fixes use_post_method #241

Merged
merged 2 commits into from Mar 19, 2020
Merged

Fixes use_post_method #241

merged 2 commits into from Mar 19, 2020

Conversation

@samsk
Copy link
Contributor

samsk commented Aug 13, 2019

When use_post_method is enabled, phprets is still adding query params to URL.

See debug from test suite of unpatched version:

57b9c3a515cb43d1141653c3f1395981.txt: POST /rets2_1/Login HTTP/1.1
Host: retsgw.flexmls.com
RETS-Version: RETS/1.7.2
Accept-Encoding: gzip

1af5d18d3171486377f6fe6c09cda258.txt: POST /rets2_1/GetMetadata?Type=METADATA-SYSTEM&ID=0&Format=STANDARD-XML HTTP/1.1
Content-Length: 45
Content-Type: application/x-www-form-urlencoded
Host: retsgw.flexmls.com
RETS-Version: RETS/1.7.2
Accept-Encoding: gzip

Type=METADATA-SYSTEM&ID=0&Format=STANDARD-XML

7dcdeb3bc5ff839b94836fb3ec2ff947.txt: POST /rets2_1/Search?SearchType=Property&Class=A&Query=%2A&QueryType=DMQL2&Count=1&Format=COMPACT-DECODED&Limit=1&StandardNames=0&Select=LIST_1 HTTP/1.1
Content-Length: 122
Content-Type: application/x-www-form-urlencoded
Host: retsgw.flexmls.com
RETS-Version: RETS/1.7.2
Accept-Encoding: gzip

SearchType=Property&Class=A&Query=%2A&QueryType=DMQL2&Count=1&Format=COMPACT-DECODED&Limit=1&StandardNames=0&Select=LIST_1

This PR fixes this by unsetting query options before doing the request and passing it only via form_params. It also fixes unit tests.
Live tested on YES-MLS for over 1 month.

samsk added 2 commits May 17, 2019
@troydavisson troydavisson merged commit 6ca3b6b into troydavisson:master Mar 19, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.