Comments (20)
ah okay, I completely missed that addition. I'm rewriting the tests to be - you know - not kiddy tests, so I'll look through them and add them to the util tests.
from spotify-web-api-kotlin.
having this problem:
Cannot set a request body for HTTP method DELETE
how did you solved it?
from spotify-web-api-kotlin.
I honestly don’t think I ever ran into that issue simply because I never completed an endpoint with an option body in DELETE. I’ll look into it
from spotify-web-api-kotlin.
I looked into it. It's a problem of jsoup. It isn't permitted to do http DELETE requests with a request body.
I didn't tested :
URL(apiEndpoint).openConnection()
yet, which would use the basic http request api of Java. Maybe I'll rewrite the execute/request function to use it instead of jsoup.
Would that be okay?
from spotify-web-api-kotlin.
To be frank, I'd prefer to use an existing HTTP library like OkHttp if we have to change how requests are made. Thoughts?
from spotify-web-api-kotlin.
I've never worked with OkHttp before, but it's worth a try. I'll present my results from testing. Today I don't have so much time, so maybe tomorrow.
from spotify-web-api-kotlin.
Now it's working, but to keep dependencies low it would be good to also replace the other functions. I couldn't get the refresh_token function to work. I pushed my code as command. Basicly OkHttp doesn't allow the x-www-form-urlencoded
MediaType because it doesn't fit a MutlipartBody. Spotify gives a 415
when using the wrong MediaType. Do you know any way to do such a request with OkHttp?
from spotify-web-api-kotlin.
Now it's working, but to keep dependencies low it would be good to also replace the other functions. I couldn't get the refresh_token function to work. I pushed my code as command. Basicly OkHttp doesn't allow the
x-www-form-urlencoded
MediaType because it doesn't fit a MutlipartBody. Spotify gives a415
when using the wrong MediaType. Do you know any way to do such a request with OkHttp?
I do not, unfortunately. I can look into it in the next few days. If you have time @molikuner, feel free to as well
from spotify-web-api-kotlin.
@molikuner do you still have interest in doing this?
from spotify-web-api-kotlin.
@adamint yes, hadn't time yet to look into it but I'm interested. Do you have a solution?
from spotify-web-api-kotlin.
Now that I have time to work on the api, I think simply creating a wrapper around Http request is the best sution. I'll add to your existing changes later today or tomorrow.
from spotify-web-api-kotlin.
The usage of the new Until functions to create URIs need to be reviewed. I thought it would be good to be able to pass a URI instead of the ID and the API should handle it. But I added it sometimes without testing and it isn't added consistently.
from spotify-web-api-kotlin.
What do you mean by the Until
functions? I'm just a little confused by what you mean.
from spotify-web-api-kotlin.
those extension functions
They can be used to be sure the ID is an ID in the request or that the URI is an URI in the request.
from spotify-web-api-kotlin.
I've been doing major refractoring inside the dev branch. If you'd like, you can checkout that branch and help port your changes over. Otherwise, I can do it in a few hours. I hope to focus more on test-driven development during this rewrite, so if you do, tests are a must.
Next, I have to retroactively add tests for nearly all the existing functions, which will take a while. After that (or if you want, you can get a head start on it), I'll be wrapping HttpsURLConnection
. I feel like the extra size isn't worth writing an extra 50 or so lines of code.
from spotify-web-api-kotlin.
Hopefully I'll get this done (finally)
from spotify-web-api-kotlin.
Ok.. so if I query the endpoint (same parameters) using Postman, it works. This must be a Jsoup issue
from spotify-web-api-kotlin.
Yes indeed. I searched a little bit.
Jsoup defines there request methods with a attribute if they can have a body. They check it before requesting. Actually by viewing the code now, I do not understand why there isn't an exception thrown, but anyways this is probably the answer why the endpoint always return with an error.
from spotify-web-api-kotlin.
Yeah I saw that. Pretty sure it’s because we ignore http errors
from spotify-web-api-kotlin.
I'm like 80% sure this works as intended but I never finished writing tests. Oops
from spotify-web-api-kotlin.
Related Issues (20)
- Android invalid grant, code verifier was incorrect HOT 5
- Spotify follow/unfollow endpoints are timing out
- getAlbumTracks 400 Error when called often HOT 8
- [Android] Using PKCE Authentication, the token scopes appears empty HOT 1
- Infinite retry loop when receiving status code 204
- Releases >3.8.0 missing iosarm64 on Maven HOT 2
- getCurrentlyPlayingRestAction unable to parse song in users "Liked Songs" HOT 8
- Implicit authentication error HOT 2
- Missing mavenCentral urls HOT 5
- Build failing because of PKCE and Implicit layouts HOT 10
- Market.FROM_TOKEN causes HTTP 400 HOT 3
- Cookie Based Auth HOT 4
- Add new apis
- Update android sample app, investigate manifestPlaceholders bug HOT 1
- Json Parsing Exception when getting playlists HOT 4
- Json Parsing Exception when TrackApi.getTrack() HOT 5
- Changed function signiture in androidx.activity:activity-compose
- NPE thrown on 429 from audio features request
- Mistake in documentation
- The RefreshTokenProducer is null
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 spotify-web-api-kotlin.