What is wrong with this delphi code for Bing translator API? -


i using follow delphi code:

 clhttp1.request.header.contenttype := 'application/x-www-form-urlencoded';  try     accountkey:=account;     clhttp1.request.addformfield('client_id',clientvalue);     clhttp1.request.addformfield('client_secret',accountkey);     clhttp1.request.header.authorization:='basic ' + encode64(accountkey + ':' + accountkey);     clhttp1.post('https://api.datamarket.azure.com/bing/microsofttranslator/v1/translate?text=%27developer%27&to=%27es%27&from=%27en%27', value); except       on e: exception         showmessage(e.message); end; 

and receive error "the authorization type provided not supported. basic , oauth supported" response

http/1.1 401 authorization type provided not supported.  basic , oauth supported server: microsoft-iis/8.0 x-content-type-options: nosniff www-authenticate: basic realm="" x-powered-by: asp.net access-control-allow-origin: * access-control-allow-credentials: false access-control-allow-headers: authorization, dataserviceversion, maxdataserviceversion access-control-expose-headers: dataserviceversion, maxdataserviceversion access-control-allow-methods: get, post, put, delete, options access-control-max-age: 604800 date: wed, 19 nov 2014 09:40:24 gmt content-length: 91 

what doing wrong?


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -