Skip to content

Incomplete HTTP headers with some versions of PHP #2

@mheadd

Description

@mheadd

Some users have reported problems when trying to send API requests to SMSified with older versions of PHP. API is responding with an HTTP 400, but the URL used in the request looks completely normal.

This might be caused by a failure to set the proper HTTP headers on the request. A work around can be implemented by simply adding the appropriate headers via CURLOPT_HTTPHEADER, like so:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded', 'Content-length: 0')); 

It might be worth adding this to the PHP library, so as to make it more compatible with older version of PHP or hosts where these headers are not added automatically.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions