473,396 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Access VBA to Connect Http Request Like Python Used

1
I have a Python Code As given below that I wish to use Access VBA to do the same thing.

Here is the Python Code example:

import datetime
import pytz
import hmac
import hashlib
import base64

username = "username"
password = "password"
access_token = "access_token"
secret_key = "secret_key"
date=datetime.datetime.now(tz=pytz.utc).astimezone (pytz.timezone('US/Pacific')).strftime('%m%d%Y')
print(date);
string_to_sign = username + password + access_token + date
print(string_to_sign);
print(secret_key);
print(hashlib.sha1)
encoded = string_to_sign.encode('UTF-8')
print(encoded)
digest = hmac.new(secret_key.encode(), encoded,hashlib.sha1).digest()
digest=base64.b64encode(digest)
headers=dict(Authorization='NNN {}:{}'.format(access_token, digest))
print(headers)


I need help to determine the functions that I have no concept of it in VBA. For example, hashlib.sha1 ? What can I use with VBA here???

What can I use with VBA for string_to sign.enccode('UTF-8')??

What can I use for the hmac.new function???

What can I use for the base64.b64encode() function???

What can I use for the dict() function????

If there isn't a VBA version of the function, a description could help me develope a version for VBA.

I am using Office 2013 VBA from Access, etc.

I would appreciate any help you can offer!!!!

Thank You,
May 22 '18 #1
0 1888

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: maong | last post by:
Is it possible for a Java network application, using HttpURLConnection, to set or influence the setting of, http headers like Connection. One example might be setting Connection: Close to indicate...
10
by: David ROBERT | last post by:
Hello, I need to read data from a MS Access database. The program (reader) is installed on a linux box and is written in python langage. The database is MS Access 2002 installed on a Win XP box...
13
by: Sateesh | last post by:
Hi, Is it possible to access Lotus notes using Python? Can anyone provide me some pointers? Thanks Sateesh
3
by: sollento | last post by:
Hello, I am writing an asp.net application to retrieve a cvs file from an http request and populate a dataset. Can someone provide sample code or a reference example. Step 1: http request to...
1
by: omantawy | last post by:
Hi, I have some legacy ASP web applications that use an unmanaged COM component to connect to a third party application. The third part application has moved to the managed code in the current...
9
by: =?Utf-8?B?RnJpdHo=?= | last post by:
Hi all, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: ======= The...
5
by: rpjanaka | last post by:
Hi all, I am using AJAX to submit a data from a web page, it is properly working on the local host (when test with the local machine it is ok).also when access from another machine the pages are...
7
by: Ron Garret | last post by:
I'm writing a little HTTP server and need to parse request content that is mime-encoded. All the MIME routines in the Python standard library seem to have been subsumed into the email package,...
0
by: Jonas Galvez | last post by:
Try: import re import urllib2 url = 'http://www.google.com/search?num=20&hl=en&q=ipod&btnG=Search' user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' headers = {'User-Agent' :...
5
by: tyakimov | last post by:
Hi guys I got a problem On my IIS server I changed the password for the Internet Guest Account 'IUSR_Machine' and suddenly the PHP part of the intranet stopped working. - '... failed to open...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.