jonasroussel / dart_jsonwebtoken

A dart implementation of the famous javascript library 'jsonwebtoken'
MIT License
87 stars 29 forks source link

[Question]: How to implement this in a custom request. #23

Closed ShimronAlakkal closed 2 years ago

ShimronAlakkal commented 2 years ago

Hi, I'm new to JWT based requests. And this really isn't an issue. This is more like a question that I would like to get cleared.

I'm working on this project where I have to send a param called fid & type in the header as payload. I would like to use HS256 algo to encode the request.

assuming that the url is

https://instagram.io/partner/details

payload

{ "fid" : "Some alphaNum value", "type": "some type string" }
fetchData({required String type, required String fid, String url}) async{

 <How to get the json web token>
<How to use HS256 encoding>
<Anything else that has to be implemented here>
 http.get(url, header : <What do I send here>);
}

How do I send this request using http with jwt. Since I'm new to this jwt based stuff, the question might not be clear. In that case, please connect with me.

Thanks.

ShimronAlakkal commented 2 years ago

Closing this issue as I was able to resolve it.