fxcm / fxcmrest-php Goto Github PK
View Code? Open in Web Editor NEWFXCM Rest API library for php
License: MIT License
FXCM Rest API library for php
License: MIT License
Describe the bug
Using example code provided, code throws "Package shorter than header specified" exception
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No exception thrown
Screenshots
No
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Cloudflare returned 400 Bad Request Error which had cause confusion.
@fxcm-pguz Hi, i want to execute a simple GET request to retrieve the AccountTable.
Can you show me a example ?
This is my code (doesn't work) :
$rest->request('GET', '/trading/get_model?model=Account', [], function($code, $data) {
var_dump($data);
});
Thank you.
API Doc : https://fxcm.github.io/rest-api-docs/#operation/tradingTable%2FAccountTable
PHP 7.3
Sample code not work on dev-master
socket error: Unable to read from stream: stream_get_contents(): SSL:
With real API
$config = new \FxcmRest\Config([
'host' => 'api.fxcm.com',
'token' => '***',
]);
With demo API
Uncaught Error: Class 'FxcmRest\Exception' not found in E:\OSpanel\domains\TradingView\vendor\fxcm\fxcmrest\src\SocketIO.php:169
$config = new \FxcmRest\Config([
'host' => 'api-demo.fxcm.com',
'token' => '***',
]);
In SocketIO class in wsdata method i get $packet:
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
Hello,
When I try to close a position, I receive the error below.
Please note I've already implemented the change mentioned in #3.
Thanks in advance,
Jonathan
Error: Uncaught Error: Class 'FxcmRest\Exception' not found in /var/www/suntrading/prod/vendor/fxcm/fxcmrest/src/SocketIO.php:169
Stack trace:
#0 /var/www/suntrading/prod/vendor/fxcm/fxcmrest/src/SocketIO.php(178): FxcmRest\SocketIO->wsdata('ter>cloudflare<...')
#1 /var/www/suntrading/prod/vendor/fxcm/fxcmrest/src/SocketIO.php(178): FxcmRest\SocketIO->wsdata(' Request</title...')
#2 /var/www/suntrading/prod/vendor/fxcm/fxcmrest/src/SocketIO.php(178): FxcmRest\SocketIO->wsdata('tent-Type: text...')
#3 /var/www/suntrading/prod/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): FxcmRest\SocketIO->wsdata('HTTP/1.1 400 Ba...')
#4 /var/www/suntrading/prod/vendor/react/stream/src/Util.php(71): Evenement\EventEmitter->emit('data', Array)
#5 /var/www/suntrading/prod/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): React\Stream\Util::React\Stream\{closure}('HTTP/1.1 400 Ba...')
#6 /var/www/suntrading/prod/vendor/react/stream/src/DuplexResourceStream.php(193): Evenement\EventEmitter->emit(
169: /var/www/suntrading/prod/vendor/fxcm/fxcmrest/src/SocketIO.php
BACKTRACE:
Line unknown: unknown
More:
Function:shutdown Class:PhpErrorHandler Object:{}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.