@@ -360,7 +360,9 @@ def get_figure(file_owner_or_url, file_id=None, raw=False):
360
360
raise exceptions .PlotlyError (
361
361
"The 'file_id' argument must be a non-negative number."
362
362
)
363
- response = requests .get (plotly_rest_url + resource , headers = headers )
363
+ response = requests .get (plotly_rest_url + resource ,
364
+ headers = headers ,
365
+ verify = get_config ()['plotly_ssl_verification' ])
364
366
if response .status_code == 200 :
365
367
if six .PY3 :
366
368
content = json .loads (response .content .decode ('unicode_escape' ))
@@ -580,10 +582,10 @@ def get(figure_or_data, format='png', width=None, height=None):
580
582
payload ['height' ] = height
581
583
582
584
url = get_config ()['plotly_domain' ] + "/apigenimage/"
583
- res = requests .post (url ,
584
- data = json .dumps (payload ,
585
- cls = utils . _plotlyJSONEncoder ),
586
- headers = headers )
585
+ res = requests .post (
586
+ url , data = json .dumps (payload , cls = utils . _plotlyJSONEncoder ) ,
587
+ headers = headers , verify = get_config ()[ 'plotly_ssl_verification' ]
588
+ )
587
589
588
590
headers = res .headers
589
591
@@ -683,7 +685,8 @@ def mkdirs(cls, folder_path):
683
685
684
686
url = _api_v2 .api_url ('folders' )
685
687
686
- res = requests .post (url , data = payload , headers = _api_v2 .headers ())
688
+ res = requests .post (url , data = payload , headers = _api_v2 .headers (),
689
+ verify = get_config ()['plotly_ssl_verification' ])
687
690
688
691
_api_v2 .response_handler (res )
689
692
@@ -734,7 +737,8 @@ def upload(cls, grid, filename,
734
737
735
738
upload_url = _api_v2 .api_url ('grids' )
736
739
req = requests .post (upload_url , data = payload ,
737
- headers = _api_v2 .headers ())
740
+ headers = _api_v2 .headers (),
741
+ verify = get_config ()['plotly_ssl_verification' ])
738
742
739
743
res = _api_v2 .response_handler (req )
740
744
@@ -776,7 +780,8 @@ def append_columns(cls, columns, grid=None, grid_url=None):
776
780
}
777
781
778
782
api_url = _api_v2 .api_url ('grids' )+ '/{grid_id}/col' .format (grid_id = grid_id )
779
- res = requests .post (api_url , data = payload , headers = _api_v2 .headers ())
783
+ res = requests .post (api_url , data = payload , headers = _api_v2 .headers (),
784
+ verify = get_config ()['plotly_ssl_verification' ])
780
785
res = _api_v2 .response_handler (res )
781
786
782
787
cls ._fill_in_response_column_ids (columns , res ['cols' ], grid_id )
@@ -808,7 +813,8 @@ def append_rows(cls, rows, grid=None, grid_url=None):
808
813
809
814
api_url = (_api_v2 .api_url ('grids' )+
810
815
'/{grid_id}/row' .format (grid_id = grid_id ))
811
- res = requests .post (api_url , data = payload , headers = _api_v2 .headers ())
816
+ res = requests .post (api_url , data = payload , headers = _api_v2 .headers (),
817
+ verify = get_config ()['plotly_ssl_verification' ])
812
818
_api_v2 .response_handler (res )
813
819
814
820
if grid :
@@ -827,7 +833,8 @@ def append_rows(cls, rows, grid=None, grid_url=None):
827
833
def delete (cls , grid = None , grid_url = None ):
828
834
grid_id = _api_v2 .parse_grid_id_args (grid , grid_url )
829
835
api_url = _api_v2 .api_url ('grids' )+ '/' + grid_id
830
- res = requests .delete (api_url , headers = _api_v2 .headers ())
836
+ res = requests .delete (api_url , headers = _api_v2 .headers (),
837
+ verify = get_config ()['plotly_ssl_verification' ])
831
838
_api_v2 .response_handler (res )
832
839
833
840
@@ -845,7 +852,8 @@ def upload(cls, meta, grid=None, grid_url=None):
845
852
846
853
api_url = _api_v2 .api_url ('grids' )+ '/{grid_id}' .format (grid_id = grid_id )
847
854
848
- res = requests .patch (api_url , data = payload , headers = _api_v2 .headers ())
855
+ res = requests .patch (api_url , data = payload , headers = _api_v2 .headers (),
856
+ verify = get_config ()['plotly_ssl_verification' ])
849
857
850
858
return _api_v2 .response_handler (res )
851
859
@@ -964,7 +972,8 @@ def _send_to_plotly(figure, **plot_options):
964
972
965
973
url = get_config ()['plotly_domain' ] + "/clientresp"
966
974
967
- r = requests .post (url , data = payload )
975
+ r = requests .post (url , data = payload ,
976
+ verify = get_config ()['plotly_ssl_verification' ])
968
977
r .raise_for_status ()
969
978
r = json .loads (r .text )
970
979
if 'error' in r and r ['error' ] != '' :
0 commit comments