Comments (11)
You have to use a proxy since you are using it from the browser. Take a look in browser examples and here https://hendt.github.io/ebay-api/
from ebay-api.
Thanks for the feedback
It's solved. I put this config (only for testing):
eBay.req.instance.interceptors.request.use((request) => {
request.url = 'https://ebay.hendt.workers.dev/' + request.url;
return request;
});
But now I have Accept-Encoding error:
This is my header:
private httpOptions = {
headers: new HttpHeaders({
'Authorization': 'Basic ' + btoa(appId + ':' + certId),
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept-Encoding': 'gzip',
'Content-Encoding': 'gzip'
})
};
How I can solve this problem?
from ebay-api.
Why do set the headers? It's not required. Just take a look in the source code of the page I posted.
from ebay-api.
That's my full configuration. But same issiue with "Accept-Encoding"
import eBayApi from '@hendt/ebay-api';
const eBay = new eBayApi({
appId: appId,
certId: certId,
sandbox: false,
});
eBay.req.instance.interceptors.request.use((request) => {
// Add Proxy
request.url = 'https://ebay.hendt.workers.dev/' + request.url;
return request;
});
eBay.commerce.taxonomy.getCategoryTree('77').then(data=>console.log(data))
from ebay-api.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@hendt/ebay-api@latest/lib/ebay-api.min.js"></script>
</head>
<body>
<script>
const eBay = new eBayApi({
appId: '-',
certId: '-'',
sandbox: false,
});
eBay.req.instance.interceptors.request.use((request) => {
request.url = 'https://ebay.hendt.workers.dev/' + request.url;
return request;
});
eBay.commerce.taxonomy.getCategoryTree('77').then(data=>console.log(data))
</script>
</body>
</html>
Tested with Chrome and FF. Both works for me.
from ebay-api.
I'm able to reproduce the error now. I'm on it.
from ebay-api.
@muhammed671 v5.0.3
should fix this issue.
from ebay-api.
Thanks for fixing. In my local test envairment it looks good. Next step, needs to check it in production on the server with my own proxy.
I will let you know about the result.
from ebay-api.
It works also on production with own proxy.
Used Proxy Server:
https://github.com/Rob--W/cors-anywhere
@dantio Thanks for support and fixing the issue
from ebay-api.
Nice! Thank you, I'll add cors-anywhere to docs also.
from ebay-api.
Nice! Thank you, I'll add cors-anywhere to docs also.
Only for your Docs. The Proxy from Rob--W/cors-anywhere works very well with heroku.com
from ebay-api.
Related Issues (20)
- I
- Inventory API > bulkMigrateListings call - Invalid value for header Accept-Language. HOT 1
- Unable to find the Account API call "getAdvertisingEligibility" HOT 2
- Can't find getAdGroups in the Marketing API calls HOT 1
- FindProducts in shopping API always returns "No Match Found" HOT 2
- createOrReplaceInventoryItem of Inventory API is not updating title, returns empty string
- Error when calling getResultFile HOT 3
- How to get rlogid from getInventoryItem call in Inventory API HOT 5
- Unable to filter using sell.fulfillment.getOrders
- GetSellerDashboard constantly returns error HOT 1
- Access token is not being refreshed by 403s on inventory item endpoint HOT 1
- Switching from axios to unjs/ofetch HOT 1
- Unable to compile ebay-api in react project HOT 1
- "could not be found or is not available in the system for the marketplace EBAY_AU" HOT 1
- listingStartDate not on type EbayOfferDetailsWithId HOT 6
- aspects in InventoryItem is now just a string HOT 12
- Adding default error handler logic HOT 5
- description: 'There was a problem with an eBay internal system or process. Contact eBay developer support for assistance', HOT 7
- getItemConditionPolicies filter is not working HOT 4
- get listing policies of sku in an inventory items HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ebay-api.