Welcome, Guest: Join Nairaland / LOGIN! / Trending / Recent / New
Stats: 2,548,967 members, 5,872,021 topics. Date: Tuesday, 22 September 2020 at 06:10 PM

You Would Better Start Programming With Java Or C# - Programming (4) - Nairaland

Nairaland Forum / Science/Technology / Programming / You Would Better Start Programming With Java Or C# (5934 Views)

Programmers: At What Age Did You Start Programming? / Top 20 Websites To Learn Coding With Java, Python, SQL, Algorithms, And Git For / Which Programming Language Is Better Java Or C+ (2) (3) (4)

(1) (2) (3) (4) (Reply) (Go Down)

Re: You Would Better Start Programming With Java Or C# by Bahat(m): 6:02pm On Sep 07
Javierleon:

Working with django helped me with the concept of errors, and then looking at the logs I began to wonder how the cookies operated, I had an issue with this HTTP, whenever I fetched a POST request, I get this Get HTTP .1 / POST ... Error
Then internal server error page displays
As long as I know, everything seems Right, the POST data is received. What can be the cause, Google isn't helping

I said earlier, as written in most documentation, cookies give web document state. You know if you're working with ftp there's no session data included or telnet. Cookie is used to track user activity on site and to sometimes verify if it's a new user or returning user.

Meself never grab the concept of cookies while getting from client system. You know cookie data are stored locally on users PC. Once it's included in the server code.

There's a lwpcookiejar() used to retrieve cookie data from clients PC I'm looking at some time ago.


You should try to validate the method type as it is in the django tutorial page like. If the request you made Is right there's no need for error to be returned but it might be something else. Django returns so much error grin

If request.method == POST:
if request.status_code != 200:
print('error code {}\n'.format(e.code))
elif request.status_code == 200:
Continue post data operation
else:
die() #php die code
for your post data methods.

Server error code will give you what type of error

Try to paste some of your code, that's where we figure out what's happening.

You won't fetch data with POST request. You only fetch data with GET request. Post is sending data to server to verify
Re: You Would Better Start Programming With Java Or C# by vheckthor1(m): 8:09pm On Sep 07
Bahat:


I said earlier, as written in most documentation, cookies give web document state. You know if you're working with ftp there's no session data included or telnet. Cookie is used to track user activity on site and to sometimes verify if it's a new user or returning user.

Meself never grab the concept of cookies while getting from client system. You know cookie data are stored locally on users PC. Once it's included in the server code.

There's a lwpcookiejar() used to retrieve cookie data from clients PC I'm looking at some time ago.


You should try to validate the method type as it is in the django tutorial page like. If the request you made Is right there's no need for error to be returned but it might be something else. Django returns so much error grin

If request.method == POST:
if request.status_code != 200:
print('error code {}\n'.format(e.code))
elif request.status_code == 200:
Continue post data operation
else:
die() #php die code
for your post data methods.

Server error code will give you what type of error

Try to paste some of your code, that's where we figure out what's happening.

You won't fetch data with POST request. You only fetch data with GET request. Post is sending data to server to verify

not entirely, you can use a post method to get and vice versa, depending on your work place policy
Re: You Would Better Start Programming With Java Or C# by Bahat(m): 8:39pm On Sep 07
vheckthor1:

not entirely, you can use a post method to get and vice versa, depending on your work place policy

Oh okay, I work as a freelancer not for a company. So I do my things my way. You can as well enlighten us on techniques
Re: You Would Better Start Programming With Java Or C# by vheckthor1(m): 11:27pm On Sep 07
Bahat:


Oh okay, I work as a freelancer not for a company. So I do my things my way. You can as well enlighten us on techniques
here at my work place, all request are made with post request, my work place is a financial institution.
Re: You Would Better Start Programming With Java Or C# by vheckthor1(m): 11:28pm On Sep 07
I was surprised when I resumed also, but I have to adapt
Re: You Would Better Start Programming With Java Or C# by vheckthor1(m): 11:28pm On Sep 07
Bahat:


Oh okay, I work as a freelancer not for a company. So I do my things my way. You can as well enlighten us on techniques
how is freelancing? and how are you getting your gigs
Re: You Would Better Start Programming With Java Or C# by cixak95211: 1:36am On Sep 08
vheckthor1:

here at my work place, all request are made with post request, my work place is a financial institution.

They need to overhaul their engineers.
It violates HTTP principles on all levels, and will cause some special APIs consumers to act funny or even break;
A POST request is expected to add a new entity and should return a 201 on success
while a GET request is expected to fetch an existing entity return a 200 on success
Sending a POST request and modifying your API to return a 200 is just plain ridiculous . . .
and like I said earlier will create confusion when publishing to specialized APIs, because the request and response headers will fail
an integrity check.

1 Like

Re: You Would Better Start Programming With Java Or C# by Bahat(m): 9:36am On Sep 08
vheckthor1:

how is freelancing? and how are you getting your gigs

I get from my contacts to make them custom apps, it's not really easy but we scaling through.
Re: You Would Better Start Programming With Java Or C# by Bahat(m): 9:39am On Sep 08
vheckthor1:

here at my work place, all request are made with post request, my work place is a financial institution.

Most workplace have their policy so you adapt when problem arise they want you to solve and not fix the main issue. God is great
Re: You Would Better Start Programming With Java Or C# by Javierleon(m): 10:54am On Sep 08
Bahat:


You should try to validate the method type as it is in the django tutorial page like. If the request you made Is right there's no need for error to be returned but it might be something else. Django returns so much error grin

If request.method == POST:
if request.status_code != 200:
print('error code {}\n'.format(e.code))
elif request.status_code == 200:
Continue post data operation
else:
die() #php die code
for your post data methods.

Try to paste some of your code, that's where we figure out what's happening.

My code works this way
If request.method==POST:
Name = request.POST['...']
... do something with name
Return Something
Return something

am using the post request to perform some operations based on what the user entered
The operations go successfully but the first return statement does not execute
Re: You Would Better Start Programming With Java Or C# by Javierleon(m): 11:00am On Sep 08
cixak95211:


They need to overhaul their engineers.
It violates HTTP principles on all levels, and will cause some special APIs consumers to act funny or even break;
A POST request is expected to add a new entity and should return a 201 on success
while a GET request is expected to fetch an existing entity return a 200 on success
Sending a POST request and modifying your API to return a 200 is just plain ridiculous . . .
and like I said earlier will create confusion when publishing to specialized APIs, because the request and response headers will fail
an integrity check.
Does this mean intercepting a POST request and not actually putting in the data somewhere will not work
what will happen if return 201 is not explicitly written
Re: You Would Better Start Programming With Java Or C# by cixak95211: 11:40am On Sep 08
Javierleon:

Does this mean intercepting a POST request and not actually putting in the data somewhere will not work
what will happen if return 201 is not explicitly written

Simply put is bad practice. And take for example . . I have a public API that sends payment to user bank accounts
The API is on Zapier and a user is trying to connect their existing with mine and they have something like this which is pretty standard . .

#1 return status === 'success' && code === 201
? TransactionPostWorker()
: TransactionFailedWorker()

Now yu see the problem, your POST requests returns a 200 and not a 201, and even tho status says success.
The only way out is for the user to go modify their API, and what if its legacy code?
They modify it, it works for me, but now it breaks for others , both internal and external. That's why there is a standard which must be adhered to.

#2 All webhooks send a POST request to servers and expect a 200 response. If you decide to go against http standards and send a 201 response for whatever reasons best to you, webhook fails. Then you modify the webhook endpoint to work with http standards and yet, other parts of the api violates the same http standards . . =>>> spaghetti code
Re: You Would Better Start Programming With Java Or C# by vheckthor1(m): 12:16pm On Sep 08
cixak95211:


They need to overhaul their engineers.
It violates HTTP principles on all levels, and will cause some special APIs consumers to act funny or even break;
A POST request is expected to add a new entity and should return a 201 on success
while a GET request is expected to fetch an existing entity return a 200 on success
Sending a POST request and modifying your API to return a 200 is just plain ridiculous . . .
and like I said earlier will create confusion when publishing to specialized APIs, because the request and response headers will fail
an integrity check.
I don't think so, the financial institution is a multinational and they clearly understand why they chose post for all request and more so a post request can be used to return other type of response, we have a custom generic response of our APIs.

1 Like

Re: You Would Better Start Programming With Java Or C# by Bahat(m): 12:48pm On Sep 08
Javierleon:

My code works this way
If request.method==POST:
Name = request.POST['...']
... do something with name
Return Something
Return something

am using the post request to perform some operations based on what the user entered
The operations go successfully but the first return statement does not execute

It's alright.
Re: You Would Better Start Programming With Java Or C# by Xperienx(m): 1:30pm On Sep 08
vheckthor1:

here at my work place, all request are made with post request, my work place is a financial institution.

This is a very bad practice and can cause some security flaws, meanwhile I won't talk much about this here

As for the POST, I think C#, PHP and JAVASCRIPT are the best tools to learn in Nigeria in terms of job opportunities unlike the US where GOlang and related dominates.

My 2cent
Re: You Would Better Start Programming With Java Or C# by vheckthor1(m): 2:17pm On Sep 08
Xperienx:


This is a very bad practice and can cause some security flaws, meanwhile I won't talk much about this here

As for the POST, I think C#, PHP and JAVASCRIPT are the best tools to learn in Nigeria in terms of job opportunities unlike the US where GOlang and related dominates.

My 2cent
Java also sells in Nigeria
Re: You Would Better Start Programming With Java Or C# by vheckthor1(m): 2:18pm On Sep 08
Xperienx:


This is a very bad practice and can cause some security flaws, meanwhile I won't talk much about this here

As for the POST, I think C#, PHP and JAVASCRIPT are the best tools to learn in Nigeria in terms of job opportunities unlike the US where GOlang and related dominates.

My 2cent

I thing Paga APIs also has no get request all is post and put
Re: You Would Better Start Programming With Java Or C# by Javierleon(m): 10:16pm On Sep 09
Javierleon:

My code works this way
If request.method==POST:
Name = request.POST['...']
... do something with name
Return Something
Return something

am using the post request to perform some operations based on what the user entered
The operations go successfully but the first return statement does not execute
I found my error, the html page the first return statement returned, I. Forgot to load a tag
Re: You Would Better Start Programming With Java Or C# by progeek37(m): 1:10pm On Sep 16
Subscribe to my Zoom tutorial today and experience a leap in your coding skill. Send me a WhatsApp message for details.
Re: You Would Better Start Programming With Java Or C# by Starry321: 6:16pm On Sep 16
josh2297:

contact me on Whatsapp 09035535062.. let me help you with some books(free).. I used to find my bearing in datascience
I just did

(1) (2) (3) (4) (Reply)

How Can I Practice Programming on My PC? / Game Ideas: Find, Post Yours, Sign Up As Developer If You Like Any. / [Help Request ] I Want To Learn Programming, what are the requirements

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2020 Oluwaseun Osewa. All rights reserved. See How To Advertise. 127
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.